<commit_before>package gov.nih.nci.cabig.caaers.web.rule.author;

import gov.nih.nci.cabig.caaers.dao.NotificationDao;
import gov.nih.nci.cabig.caaers.dao.StudyDao;
import gov.nih.nci.cabig.caaers.rules.author.RuleAuthoringService;
import gov.nih.nci.cabig.caaers.rules.business.service.RulesEngineService;
import gov.nih.nci.cabig.caaers.web.rule.AbstractRuleInputController;

import java.util.HashMap;
import java.util.Map;

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

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author <NAME>
 * */
public class CreateRuleController extends AbstractRuleInputController<CreateRuleCommand> {

	private RuleAuthoringService ruleAuthoringService;
	
	private StudyDao studyDao;
	
	private NotificationDao notificationDao;
	
	private RulesEngineService rulesEngineService;
	
    public NotificationDao getNotificationDao() {
		return notificationDao;
	}

	public void setNotificationDao(NotificationDao notificationDao) {
		this.notificationDao = notificationDao;
	}

	public CreateRuleController() {
    	super();
    	setBindOnNewForm(false);
        addTabs();
    }

	@Override
	protected ModelAndView processFinish(HttpServletRequest arg0, HttpServletResponse arg1, Object oCommand, BindException arg3) throws Exception {
		CreateRuleCommand command = (CreateRuleCommand) oCommand;
        command.save();
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("ruleSet", command.getRuleSet());
        return new ModelAndView("redirectToTriggerList", model);

	}
	
	@Override
	protected Object formBackingObject(HttpServletRequest request) {
		return new CreateRuleCommand(ruleAuthoringService, studyDao, notificationDao, rulesEngineService);	
	}

    @Override
    protected void initFlow() {
        super.initFlow();
        
    }

    @Override
    protected String getFlowName() {
        return "Author Rule";
    }
    
    protected void addTabs() 
    {
    	getFlow().addTab(new SelectRuleTypeTab());
    	getFlow().addTab(new DisplayRuleSetsTab());
        getFlow().addTab(new RuleTab());
        getFlow().addTab(new ReviewTab());
    }    
    
	public RuleAuthoringService getRuleAuthoringService() {
		return ruleAuthoringService;
	}

	public void setRuleAuthoringService(RuleAuthoringService ruleAuthoringService) {
		this.ruleAuthoringService = ruleAuthoringService;
	}

	public StudyDao getStudyDao() {
		return studyDao;
	}

	public void setStudyDao(StudyDao studyDao) {
		this.studyDao = studyDao;
	}

	public RulesEngineService getRulesEngineService() {
		return rulesEngineService;
	}

	public void setRulesEngineService(RulesEngineService rulesEngineService) {
		this.rulesEngineService = rulesEngineService;
	}
}<commit_msg>ReportDefinition added<commit_after>package gov.nih.nci.cabig.caaers.web.rule.author;

import gov.nih.nci.cabig.caaers.dao.NotificationDao;
import gov.nih.nci.cabig.caaers.dao.StudyDao;
import gov.nih.nci.cabig.caaers.dao.report.ReportDefinitionDao;
import gov.nih.nci.cabig.caaers.rules.author.RuleAuthoringService;
import gov.nih.nci.cabig.caaers.rules.business.service.RulesEngineService;
import gov.nih.nci.cabig.caaers.web.rule.AbstractRuleInputController;

import java.util.HashMap;
import java.util.Map;

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

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author <NAME>
 * */
public class CreateRuleController extends AbstractRuleInputController<CreateRuleCommand> {

	private RuleAuthoringService ruleAuthoringService;
	
	private StudyDao studyDao;
	
	private NotificationDao notificationDao;
	
	private ReportDefinitionDao reportDefinitionDao;
	
	private RulesEngineService rulesEngineService;
	
    public NotificationDao getNotificationDao() {
		return notificationDao;
	}

	public void setNotificationDao(NotificationDao notificationDao) {
		this.notificationDao = notificationDao;
	}

	public CreateRuleController() {
    	super();
    	setBindOnNewForm(false);
        addTabs();
    }

	@Override
	protected ModelAndView processFinish(HttpServletRequest arg0, HttpServletResponse arg1, Object oCommand, BindException arg3) throws Exception {
		CreateRuleCommand command = (CreateRuleCommand) oCommand;
        command.save();
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("ruleSet", command.getRuleSet());
        return new ModelAndView("redirectToTriggerList", model);

	}
	
	@Override
	protected Object formBackingObject(HttpServletRequest request) {
		return new CreateRuleCommand(ruleAuthoringService, studyDao, notificationDao, rulesEngineService,reportDefinitionDao);	
	}

    @Override
    protected void initFlow() {
        super.initFlow();
        
    }

    @Override
    protected String getFlowName() {
        return "Author Rule";
    }
    
    protected void addTabs() 
    {
    	getFlow().addTab(new SelectRuleTypeTab());
    	getFlow().addTab(new DisplayRuleSetsTab());
        getFlow().addTab(new RuleTab());
        getFlow().addTab(new ReviewTab());
    }    
    
	public RuleAuthoringService getRuleAuthoringService() {
		return ruleAuthoringService;
	}

	public void setRuleAuthoringService(RuleAuthoringService ruleAuthoringService) {
		this.ruleAuthoringService = ruleAuthoringService;
	}

	public StudyDao getStudyDao() {
		return studyDao;
	}

	public void setStudyDao(StudyDao studyDao) {
		this.studyDao = studyDao;
	}

	public RulesEngineService getRulesEngineService() {
		return rulesEngineService;
	}

	public void setRulesEngineService(RulesEngineService rulesEngineService) {
		this.rulesEngineService = rulesEngineService;
	}

	public ReportDefinitionDao getReportDefinitionDao() {
		return reportDefinitionDao;
	}

	public void setReportDefinitionDao(ReportDefinitionDao reportDefinitionDao) {
		this.reportDefinitionDao = reportDefinitionDao;
	}
}
{'fraction_non_alphanumeric': 0.08656620711766592, 'fraction_numerical': 0.0009618467457518436, 'mean_word_length': 4.011244979919678, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1798451', 'n_tokens_mistral': 1882, 'n_tokens_neox': 1826, 'n_words': 329}