<commit_before>package gov.nih.nci.calab.ui.workflow;

/**
 * This class saves user entered new Run information 
 * into the database.
 * 
 * @author caLAB Team
 */

import gov.nih.nci.calab.ui.core.AbstractBaseAction;
import gov.nih.nci.calab.dto.security.SecurityBean;
import gov.nih.nci.calab.service.common.LookupService;
import gov.nih.nci.calab.service.util.StringUtils;
import gov.nih.nci.calab.service.workflow.ExecuteWorkflowService;


import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.validator.DynaValidatorActionForm;
import org.apache.struts.validator.DynaValidatorForm;


import gov.nih.nci.calab.dto.workflow.ExecuteWorkflowBean;
import gov.nih.nci.calab.service.workflow.ExecuteWorkflowService;

public class CreateRunAction extends AbstractBaseAction {
	private static Logger logger = Logger.getLogger(CreateRunAction.class);

	public ActionForward executeTask(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward forward = null;
		HttpSession session = request.getSession();
		ActionMessages messages=new ActionMessages();
		try {
			// TODO fill in details for aliquot information */
			DynaValidatorForm theForm = (DynaValidatorForm) form;
			
			//Get Prameters from form elements
			//Run info 
			
			String assayId = (String) theForm.get("assay");			
			String runBy = (String) theForm.get("runBy");
			String runDate = (String) theForm.get("runDate");
			// get user and date information from session
			String creator = (String)session.getAttribute("creator");
			String creationDate=(String)session.getAttribute("creationDate");
			ExecuteWorkflowService workflowService=new ExecuteWorkflowService();
			String runId = workflowService.saveRun(assayId,runBy,runDate,creator,creationDate);
			session.setAttribute("runId", runId);			
			//set Forward
			forward = mapping.findForward("success");
		} catch (Exception e) {
			ActionMessage error=new ActionMessage("error.createRun");
			messages.add("error", error);
			saveMessages(request, messages);
			logger.error("Caught exception when executing Run", e);
			forward = mapping.getInputForward();
		}
		return forward;
	}

	public boolean loginRequired() {
		// temporarily set to false until login module is working
		return false;
		// return true;
	}
}
<commit_msg>login required<commit_after>package gov.nih.nci.calab.ui.workflow;

/**
 * This class saves user entered new Run information 
 * into the database.
 * 
 * @author caLAB Team
 */

import gov.nih.nci.calab.ui.core.AbstractBaseAction;
import gov.nih.nci.calab.dto.security.SecurityBean;
import gov.nih.nci.calab.service.common.LookupService;
import gov.nih.nci.calab.service.util.StringUtils;
import gov.nih.nci.calab.service.workflow.ExecuteWorkflowService;


import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.validator.DynaValidatorActionForm;
import org.apache.struts.validator.DynaValidatorForm;


import gov.nih.nci.calab.dto.workflow.ExecuteWorkflowBean;
import gov.nih.nci.calab.service.workflow.ExecuteWorkflowService;

public class CreateRunAction extends AbstractBaseAction {
	private static Logger logger = Logger.getLogger(CreateRunAction.class);

	public ActionForward executeTask(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward forward = null;
		HttpSession session = request.getSession();
		ActionMessages messages=new ActionMessages();
		try {
			// TODO fill in details for aliquot information */
			DynaValidatorForm theForm = (DynaValidatorForm) form;
			
			//Get Prameters from form elements
			//Run info 
			
			String assayId = (String) theForm.get("assay");			
			String runBy = (String) theForm.get("runBy");
			String runDate = (String) theForm.get("runDate");
			// get user and date information from session
			String creator = (String)session.getAttribute("creator");
			String creationDate=(String)session.getAttribute("creationDate");
			ExecuteWorkflowService workflowService=new ExecuteWorkflowService();
			String runId = workflowService.saveRun(assayId,runBy,runDate,creator,creationDate);
			session.setAttribute("runId", runId);			
			//set Forward
			forward = mapping.findForward("success");
		} catch (Exception e) {
			ActionMessage error=new ActionMessage("error.createRun");
			messages.add("error", error);
			saveMessages(request, messages);
			logger.error("Caught exception when executing Run", e);
			forward = mapping.getInputForward();
		}
		return forward;
	}

	public boolean loginRequired() {		
		 return true;
	}
}

{'fraction_non_alphanumeric': 0.10476891916774075, 'fraction_numerical': 0.0003682563063892469, 'mean_word_length': 5.035555555555556, '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': '1082882', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1591, 'n_words': 346}