<commit_before>package gov.nih.nci.evs.browser.servlet;

import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;

public class MappingServlet extends HttpServlet {

   public void init(ServletConfig config)
	           throws ServletException
   {
      super.init(config);
   }

   public void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws IOException, ServletException
   {
        execute(request, response);
   }


   public void doPost(HttpServletRequest request,
                     HttpServletResponse response)
              throws IOException, ServletException
   {
        execute(request, response);
   }

   public void execute(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        long ms = System.currentTimeMillis();

		response.setContentType("application/vnd.ms-excel");
		response.setHeader("Cache-Control", "no-cache");
        PrintWriter out = response.getWriter();

      out.println("<table>");
      out.println("   <th class=\"dataTableHeader\" width=\"60px\" scope=\"col\" align=\"left\">Source</th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Source Code");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Source Name");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"30px\" scope=\"col\" align=\"left\">");
      out.println("	  REL");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"35px\" scope=\"col\" align=\"left\">");
      out.println("	  Map Rank");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"60px\" scope=\"col\" align=\"left\">Target</th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Target Code");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Target Name");
      out.println("   </th>");
      out.println("</table>");


   }

}




/*
<<table>
   <th class="dataTableHeader" width="60px" scope="col" align="left">Source</th>
   <th class="dataTableHeader" scope="col" align="left">
	  Source Code
   </th>
   <th class="dataTableHeader" scope="col" align="left">
	  Source Name
   </th>
   <th class="dataTableHeader" width="30px" scope="col" align="left">
	  REL
   </th>
   <th class="dataTableHeader" width="35px" scope="col" align="left">
	  Map Rank
   </th>
   <th class="dataTableHeader" width="60px" scope="col" align="left">Target</th>
   <th class="dataTableHeader" scope="col" align="left">
	  Target Code
   </th>
   <th class="dataTableHeader" scope="col" align="left">
	  Target Name
   </th>
</table>


		   for (int lcv2=0; lcv2<selected_matches.size(); lcv2++) {
		         String rel_id = "rel" + "_" + lcv + "_" + lcv2;
		         String score_id = "score" + "_" + lcv + "_" + lcv2;
		         String idx2_str = new Integer(lcv2).toString();
				 mappingData = (MappingData) selected_matches.get(lcv2);
				 source_code = mappingData.getSourceCode();
				 source_name = mappingData.getSourceName();
				 source_namespace = mappingData.getSourceCodeNamespace();
				 rel = mappingData.getRel();
				 if (DataUtils.isNull(rel)) rel = "";
				 score = new Integer(mappingData.getScore()).toString();
				 target_code = mappingData.getTargetCode();
				 target_name = mappingData.getTargetName();
				 target_namespace = mappingData.getTargetCodeNamespace();
				 source_scheme = mappingData.getSourceCodingScheme();
				 source_version = mappingData.getSourceCodingSchemeVersion();
				 target_scheme = mappingData.getTargetCodingScheme();
				 target_version = mappingData.getTargetCodingSchemeVersion();
				 source_scheme = DataUtils.getFormalName(source_scheme);
				 target_scheme = DataUtils.getFormalName(target_scheme);
				 target_codingscheme = target_scheme;
				 target_codingschemeversion = target_version;

			 <tr>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 </tr>
		   }


</table>
*/

<commit_msg>MappingServlet.java initial implementation [KLO, 032412]<commit_after>package gov.nih.nci.evs.browser.servlet;

import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;

public class MappingServlet extends HttpServlet {

   public void init(ServletConfig config)
	           throws ServletException
   {
      super.init(config);
   }

   public void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws IOException, ServletException
   {
        execute(request, response);
   }


   public void doPost(HttpServletRequest request,
                     HttpServletResponse response)
              throws IOException, ServletException
   {
        execute(request, response);
   }

   public void execute(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        long ms = System.currentTimeMillis();

        String identifier = (String) request.getParameter("identifier");
        if (identifier == null) {
		    identifier = "mapping";
		}
		identifier = identifier + ".xls";

		response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-Disposition", "attachment; filename="
                    + identifier);

        PrintWriter out = response.getWriter();

      out.println("<table>");
      out.println("   <th class=\"dataTableHeader\" width=\"60px\" scope=\"col\" align=\"left\">Source</th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Source Code");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Source Name");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"30px\" scope=\"col\" align=\"left\">");
      out.println("	  REL");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"35px\" scope=\"col\" align=\"left\">");
      out.println("	  Map Rank");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" width=\"60px\" scope=\"col\" align=\"left\">Target</th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Target Code");
      out.println("   </th>");
      out.println("   <th class=\"dataTableHeader\" scope=\"col\" align=\"left\">");
      out.println("	  Target Name");
      out.println("   </th>");
      out.println("</table>");


   }

}




/*
<<table>
   <th class="dataTableHeader" width="60px" scope="col" align="left">Source</th>
   <th class="dataTableHeader" scope="col" align="left">
	  Source Code
   </th>
   <th class="dataTableHeader" scope="col" align="left">
	  Source Name
   </th>
   <th class="dataTableHeader" width="30px" scope="col" align="left">
	  REL
   </th>
   <th class="dataTableHeader" width="35px" scope="col" align="left">
	  Map Rank
   </th>
   <th class="dataTableHeader" width="60px" scope="col" align="left">Target</th>
   <th class="dataTableHeader" scope="col" align="left">
	  Target Code
   </th>
   <th class="dataTableHeader" scope="col" align="left">
	  Target Name
   </th>
</table>


		   for (int lcv2=0; lcv2<selected_matches.size(); lcv2++) {
		         String rel_id = "rel" + "_" + lcv + "_" + lcv2;
		         String score_id = "score" + "_" + lcv + "_" + lcv2;
		         String idx2_str = new Integer(lcv2).toString();
				 mappingData = (MappingData) selected_matches.get(lcv2);
				 source_code = mappingData.getSourceCode();
				 source_name = mappingData.getSourceName();
				 source_namespace = mappingData.getSourceCodeNamespace();
				 rel = mappingData.getRel();
				 if (DataUtils.isNull(rel)) rel = "";
				 score = new Integer(mappingData.getScore()).toString();
				 target_code = mappingData.getTargetCode();
				 target_name = mappingData.getTargetName();
				 target_namespace = mappingData.getTargetCodeNamespace();
				 source_scheme = mappingData.getSourceCodingScheme();
				 source_version = mappingData.getSourceCodingSchemeVersion();
				 target_scheme = mappingData.getTargetCodingScheme();
				 target_version = mappingData.getTargetCodingSchemeVersion();
				 source_scheme = DataUtils.getFormalName(source_scheme);
				 target_scheme = DataUtils.getFormalName(target_scheme);
				 target_codingscheme = target_scheme;
				 target_codingschemeversion = target_version;

			 <tr>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 	<td class="datacoldark"><%=source_namespace%></td>
			 </tr>
		   }


</table>
*/


{'fraction_non_alphanumeric': 0.16176170038830984, 'fraction_numerical': 0.005722460658082976, 'mean_word_length': 2.9257922182109906, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 117, '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': '1894858', 'n_tokens_mistral': 3162, 'n_tokens_neox': 2815, 'n_words': 556}