<commit_before>// Created by Xslt generator for Eclipse.
// XSL :  not found (java.io.FileNotFoundException:  (Bad file descriptor))
// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl

package gov.nih.nci.nautilus.struts.action;

import gov.nih.nci.nautilus.struts.form.GeneExpressionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;

import gov.nih.nci.nautilus.criteria.*;
import gov.nih.nci.nautilus.query.*;
import gov.nih.nci.nautilus.view.*;
import gov.nih.nci.nautilus.constants.Constants;



/** 
 * GeneexpressionAction.java created by EasyStruts - XsltGen.
 * http://easystruts.sf.net
 * created on 08-11-2004
 * 
 * XDoclet definition:
 * @struts:action path="/geneexpression" name="geneexpressionForm" input="/jsp/geneexpression.jsp" validate="true"
 * @struts:action-forward name="/jsp/advanceSearchMenu.jsp" path="/jsp/advanceSearchMenu.jsp"
 * @struts:action-forward name="/jsp/queryPreview.jsp" path="/jsp/queryPreview.jsp"
 */
public class GeneexpressionAction extends Action {

	// --------------------------------------------------------- Instance Variables

	// --------------------------------------------------------- Methods

	/** 
	 * Method execute
	 * @param ActionMapping mapping
	 * @param ActionForm form
	 * @param HttpServletRequest request
	 * @param HttpServletResponse response
	 * @return ActionForward
	 * @throws Exception
	 */
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		
		GeneExpressionForm geneExpressionForm = (GeneExpressionForm) form;		
		String thisView = geneExpressionForm.getResultView();
		
		// Create Query Objects
		GeneExpressionQuery geneExpQuery = (GeneExpressionQuery) QueryManager.createQuery(QueryType.GENE_EXPR_QUERY_TYPE);
		geneExpQuery.setQueryName(geneExpressionForm.getQueryName());
		
		// Change this code later to get view type directly from Form !!
		if (thisView.equalsIgnoreCase("sample")) {
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.CLINICAL_VIEW));
			}
		else if (thisView.equalsIgnoreCase("gene")){
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.GENE_SINGLE_SAMPLE_VIEW));
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.GENE_SINGLE_SAMPLE_VIEW));
			}
		
		// Set gene criteria
		GeneIDCriteria geneIDCrit = geneExpressionForm.getGeneIDCriteria();
		geneExpQuery.setGeneIDCrit(geneIDCrit);
		
		FoldChangeCriteria foldChangeCrit = geneExpressionForm.getFoldChangeCriteria();
		geneExpQuery.setFoldChgCrit(foldChangeCrit);
		
		RegionCriteria regionCrit = geneExpressionForm.getRegionCriteria();
		geneExpQuery.setRegionCrit(regionCrit);

		DiseaseOrGradeCriteria diseaseOrGradeCriteria = geneExpressionForm.getDiseaseOrGradeCriteria();
		geneExpQuery.setDiseaseOrGradeCrit(diseaseOrGradeCriteria);
		
		CloneOrProbeIDCriteria cloneOrProbeIDCriteria = geneExpressionForm.getCloneOrProbeIDCriteria();
		geneExpQuery.setCloneOrProbeIDCrit(cloneOrProbeIDCriteria);
		
		GeneOntologyCriteria geneOntologyCriteria = geneExpressionForm.getGeneOntologyCriteria();
		geneExpQuery.setGeneOntologyCrit(geneOntologyCriteria);
		
		PathwayCriteria pathwayCriteria = geneExpressionForm.getPathwayCriteria();
		geneExpQuery.setPathwayCrit(pathwayCriteria);
		
		ArrayPlatformCriteria arrayPlatformCriteria = geneExpressionForm.getArrayPlatformCriteria();
		geneExpQuery.setArrayPlatformCrit(arrayPlatformCriteria);
		
		
	
		<commit_msg>Save Criteria to Query only if it is not null<commit_after>// Created by Xslt generator for Eclipse.
// XSL :  not found (java.io.FileNotFoundException:  (Bad file descriptor))
// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl

package gov.nih.nci.nautilus.struts.action;

import gov.nih.nci.nautilus.struts.form.GeneExpressionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;

import gov.nih.nci.nautilus.criteria.*;
import gov.nih.nci.nautilus.query.*;
import gov.nih.nci.nautilus.view.*;
import gov.nih.nci.nautilus.constants.Constants;



/** 
 * GeneexpressionAction.java created by EasyStruts - XsltGen.
 * http://easystruts.sf.net
 * created on 08-11-2004
 * 
 * XDoclet definition:
 * @struts:action path="/geneexpression" name="geneexpressionForm" input="/jsp/geneexpression.jsp" validate="true"
 * @struts:action-forward name="/jsp/advanceSearchMenu.jsp" path="/jsp/advanceSearchMenu.jsp"
 * @struts:action-forward name="/jsp/queryPreview.jsp" path="/jsp/queryPreview.jsp"
 */
public class GeneexpressionAction extends Action {

	// --------------------------------------------------------- Instance Variables

	// --------------------------------------------------------- Methods

	/** 
	 * Method execute
	 * @param ActionMapping mapping
	 * @param ActionForm form
	 * @param HttpServletRequest request
	 * @param HttpServletResponse response
	 * @return ActionForward
	 * @throws Exception
	 */
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		
		GeneExpressionForm geneExpressionForm = (GeneExpressionForm) form;		
		String thisView = geneExpressionForm.getResultView();
		
		// Create Query Objects
		GeneExpressionQuery geneExpQuery = (GeneExpressionQuery) QueryManager.createQuery(QueryType.GENE_EXPR_QUERY_TYPE);
		geneExpQuery.setQueryName(geneExpressionForm.getQueryName());
		
		// Change this code later to get view type directly from Form !!
		if (thisView.equalsIgnoreCase("sample")) {
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.CLINICAL_VIEW));
			}
		else if (thisView.equalsIgnoreCase("gene")){
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.GENE_SINGLE_SAMPLE_VIEW));
			geneExpQuery.setAssociatedView(ViewFactory.newView(ViewType.GENE_SINGLE_SAMPLE_VIEW));
			}
		
		// Set gene criteria
		GeneIDCriteria geneIDCrit = geneExpressionForm.getGeneIDCriteria();
		if (!geneIDCrit.isEmpty())
			geneExpQuery.setGeneIDCrit(geneIDCrit);
		
		FoldChangeCriteria foldChangeCrit = geneExpressionForm.getFoldChangeCriteria();
		if (!foldChangeCrit.isEmpty())
			geneExpQuery.setFoldChgCrit(foldChangeCrit);
		
		RegionCriteria regionCrit = geneExpressionForm.getRegionCriteria();
		if (!regionCrit.isEmpty())
			geneExpQuery.setRegionCrit(regionCrit);

		DiseaseOrGradeCriteria diseaseOrGradeCriteria = geneExpressionForm.getDiseaseOrGradeCriteria();
		if (!diseaseOrGradeCriteria.isEmpty())
			geneExpQuery.setDiseaseOrGradeCrit(diseaseOrGradeCriteria);
		
		CloneOrProbeIDCriteria cloneOrProbeIDCriteria = geneExpressionForm.getCloneOrProbeIDCriteria();
		if (!cloneOrProbeIDCriteria.isEmpty())
			geneExpQuery.setCloneOrProbeIDCrit(cloneOrProbeIDCriteria);
		
		GeneOntologyCriteria geneOntologyCriteria = geneExpressionForm.getGeneOntologyCriteria();
		if (!geneOntologyCriteria.isEmpty())
			geneExpQuery.setGeneOntologyCrit(geneOntologyCriteria);
		
		PathwayCriteria pathwayCriteria = geneExpressionForm.getPathwayCriteria();
		if (!pathwayCriteria.isEmpty())
			geneExpQuery.setPathwayCrit(pathwayCriteria);
		
		ArrayPlatformCriteria arrayPlatformCriteria = geneExpressionForm.getArrayPlatformCriteria();
		if (!arrayPlatformCriteria.isEmpty())
			geneExpQuery.setArrayPlatformCrit(arrayPlatformCriteria);
		
		
	
		
{'fraction_non_alphanumeric': 0.12287287287287288, 'fraction_numerical': 0.002002002002002002, 'mean_word_length': 4.859970674486804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1700346', 'n_tokens_mistral': 2607, 'n_tokens_neox': 2262, 'n_words': 381}