anchor.diff: -<%@ page language="java" contentType="text/javascript; charset=UTF-8"
  -    pageEncoding="UTF-8"%>
  -    
  +<%@ page language="java" contentType="text/javascript; charset=UTF-8" pageEncoding="UTF-8"%>
   <%@ page import="org.mskcc.cbio.portal.servlet.CheckDarwinAccessServlet" %>
   <%@ page import="org.mskcc.cbio.portal.util.GlobalProperties" %>
  -
  -<%--
  -legacyConfig = 
  -{
  -    enableDarwin : <%=CheckDarwinAccessServlet.CheckDarwinAccess.existsDarwinProperties()%>,
  -    appVersion : '<%=GlobalProperties.getAppVersion()%>',
  -    maxTreeDepth : <%=GlobalProperties.getMaxTreeDepth()%>,
  -    showOncoKB : <%=GlobalProperties.showOncoKB()%>,
  -    oncoKBApiUrl : '<%=GlobalProperties.getOncoKBPublicApiUrl()%>',
  -    genomeNexusApiUrl : '<%=GlobalProperties.getGenomeNexusApiUrl()%>',
  -    showCivic : <%=GlobalProperties.showCivic()%>,
  -    showHotspot : <%=GlobalProperties.showHotspot()%>,
  -    showMyCancerGenome : <%=GlobalProperties.showMyCancerGenomeUrl()%>,
  -    showGenomeNexus : <%=GlobalProperties.showGenomeNexus()%>,
  -    querySetsOfGenes : JSON.parse('<%=GlobalProperties.getQuerySetsOfGenes()%>'),
  -    bitlyToken: '<%=GlobalProperties.getBitlyAccessToken()%>',
  -    skinBlurb : '<%=GlobalProperties.getBlurb()%>',
  -
  -    skinExampleStudyQueries : '<%=GlobalProperties.getExampleStudyQueries().replace("\n","\\n")%>'.split("\n"),
  -
  -    skinDatasetHeader : '<%=GlobalProperties.getDataSetsHeader()%>',
  -    skinDatasetFooter : '<%=GlobalProperties.getDataSetsFooter()%>',
  -    skinRightNavShowDatasets : <%=GlobalProperties.showRightNavDataSets()%>,
  -    skinRightNavShowExamples : <%=GlobalProperties.showRightNavExamples()%>,
  -    skinRightNavShowTestimonials : <%=GlobalProperties.showRightNavTestimonials()%>,
  -    skinRightNavExamplesHTML : '<%=GlobalProperties.getExamplesRightColumnHtml()%>',
  -    skinRightNavExamplesHTML : '<%=GlobalProperties.getExamplesRightColumnHtml()%>',
  -    skinRightNavWhatsNewBlurb : '<%=GlobalProperties.getRightNavWhatsNewBlurb()%>',
  -    skinRightLogo : '<%=GlobalProperties.getRightLogo()%>',
  -    skinTitle : '<%=GlobalProperties.getTitle()%>',
  -    
  -    userEmailAddress : '<%=GlobalProperties.getAuthenticatedUserName()%>',
  -    
  -    oncoprintCustomDriverAnnotationBinaryMenuLabel: '<%=GlobalProperties.getBinaryCustomDriverAnnotationMenuLabel()%>',
  -    oncoprintCustomDriverAnnotationTiersMenuLabel: '<%=GlobalProperties.getTiersCustomDriverAnnotationMenuLabel()%>',
  -    oncoprintCustomDriverAnnotationDefault:'<%=GlobalProperties.enableDriverAnnotations()%>' !== "false", // true unless "false"
  -    oncoprintCustomDriverTiersAnnotationDefault:'<%=GlobalProperties.enableTiers()%>' !== "false", // true unless "false"
  -    oncoprintOncoKbHotspotsDefault:{"true":undefined, "false":"disable", "custom":"custom"}['<%=GlobalProperties.enableOncoKBandHotspots()%>'],
  -    oncoprintHideVUSDefault:'<%=GlobalProperties.hidePassengerMutations()%>' === "true", // false unless "true"
  -    priorityStudies : <%=studies%>,  //done
  -    sessionServiceIsEnabled: '<%=GlobalProperties.getSessionServiceUrl()%>' !== "",
  -    sessionServiceUrl: '<%=GlobalProperties.getSessionServiceUrl()%>',
  -    baseUrl:"<%=baseURL%>",
  -    fontendCongfigOveride:JSON.parse('<%=GlobalProperties.getFrontendConfig()%>'),
  -    skinShowDataTabSets: (<%=GlobalProperties.showDataTab()%> === true),
  -    skinShowNewsTab: (<%=GlobalProperties.showNewsTab()%> === true),
  -    skinShowFAQSTab: (<%=GlobalProperties.showFaqsTab()%> === true),
  -    skinShowToolsTab: (<%=GlobalProperties.showToolsTab()%> === true),
  -    skinShowAboutTab: (<%=GlobalProperties.showAboutTab()%> === true),
  -    skinShowWebAPITab: (<%=GlobalProperties.showWebApiTab()%> === true),
  -    skinShowRmatLABTab : (<%=GlobalProperties.showRMatlabTab()%> === true),
  -    skinShowTutorialsTab: (<%=GlobalProperties.showTutorialsTab()%> === true),
  -    emailContactAddress: "<%=GlobalProperties.getContactEmailAddress()%>",
  -    skinDocumentationBaseUrl: "<%=GlobalProperties.getBaseUrl()%>",
  -    skinIsMarkdownDocumentation: (<%=GlobalProperties.isMarkdownDocumentation()%> === true),
  -    skinFaqSourceURL: "<%=GlobalProperties.getFaqHtml()%>",
  -    skinAboutSourceURL: "<%=GlobalProperties.getAboutHtml()%>",
  -    skinNewsSourceURL: "<%=GlobalProperties.getNewsHtml()%>",
  -    skinOQLSourceURL: "<%=GlobalProperties.getOqlHtml()%>",
  -    googleAnalyticsProfile: "<%=GlobalProperties.getGoogleAnalyticsProfileId()%>",
  -    
  -   
  -};
  ---%>
  +<%@ page import="org.json.simple.JSONArray" %>
  +<%@ page import="org.json.simple.JSONObject" %>
   
   // an empty string means the property is listed but not assigned to in portal.props 
   // a null value means it was entirely missing 
   
  -<%= request.getParameter("callback") %>({
  +<%= request.getParameter("callback") %>(
   
       <%
  -    
           // 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();
  
positive.code:            
          }; 
      
          // for each above, add json prop and lookup value in portal.properties
          for (int i = 0; i < propNameArray.length; i++){
              
                String value = GlobalProperties.getProperty(propNameArray[i]);
                
                if (value != null) {
                  // do not stringify boolean values
                  // need to improve boolean detection or use JSON writing service
                  value = String.format("\"%s\"", value.replace("\"","\\\""));
                }
                
                String key = propNameArray[i].replace(".","_");
                
                out.println(String.format("\"%s\" : %s,", key, value));
  
          }
          
          // these are some custom props which are not read directly from portal.props
          
          out.println(String.format("\"%s\" : %s,", "enable_darwin", CheckDarwinAccessServlet.CheckDarwinAccess.existsDarwinProperties()));
              
          out.println(String.format("\"%s\" : %s,", "query_sets_of_genes", GlobalProperties.getQuerySetsOfGenes()));
          
          out.println(String.format("\"%s\" : \"%s\",", "base_url", baseURL)); 
          
          out.println(String.format("\"%s\" : \"%s\",", "user_email_address", GlobalProperties.getAuthenticatedUserName()));     
          
          out.println(String.format("\"%s\" : %s,", "frontendConfigOverride", GlobalProperties.getFrontendConfig()));     
                  
         
          String enableOncoKBandHotspots = "";
          switch(GlobalProperties.enableOncoKBandHotspots()){
              case "true":
  
negative.code:             case "custom":
                  enableOncoKBandHotspots = "\"custom\"";
          }
               
          obj.put("oncoprintOncoKbHotspotsDefault",enableOncoKBandHotspots);        
                  
          out.println(obj.toJSONString());       
                        
        
       %>
  
  );
  
  