<commit_before>/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.dataimporttool.web.controller;


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

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

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.api.context.ServiceContext;
import org.openmrs.module.dataimporttool.api.DataImportToolService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.ParameterizableViewController;



public class ContinueMigrationController extends ParameterizableViewController{

	/** Logger for this class and subclasses */
	protected final Log log = LogFactory.getLog(getClass());

	/**
    	 * @see org.springframework.web.servlet.mvc.ParameterizableViewController#handleRequestInternal(javax.servlet.http.HttpServletRequest, 		 *	javax.servlet.http.HttpServletResponse)
     	 */
    	@Override
    	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
	    	Map<String, Object> model = new HashMap<String, Object>();
	    
	    	DataImportToolService svc = (DataImportToolService)ServiceContext.getInstance().getService(DataImportToolService.class);
	    
	    	log.info("Starting Data Migration" + " for Migration Setting " + svc.getDataImportTool(0));
	    	svc.doMigration();
	    
	    	return new ModelAndView("redirect:/module/dataimporttool/status.page");
    	}
}
<commit_msg>Added Continue Migration controller function<commit_after>/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.dataimporttool.web.controller;


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

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

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.module.dataimporttool.api.DataImportToolService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;



public class ContinueMigrationController  extends CommonsMultipartResolver{

		/** Logger for this class and subclasses */
		protected final Log log = LogFactory.getLog(getClass());

		/**
    	 * @see org.springframework.web.servlet.mvc.ParameterizableViewController#handleRequestInternal(javax.servlet.http.HttpServletRequest, 		 	 *	javax.servlet.http.HttpServletResponse)
     	 */
     	 @RequestMapping("/module/dataimporttool/continueMigration.page")
		public ModelAndView continueMigration() {
		
			DataImportTool dit;
			ModelMap model = new ModelMap();
			
			log.info("Starting Data Migration");
			DataImportToolService ditService = Context.getService(DataImportToolService.class);
			dit = DataImportToolService.getDataImportTool(dit.getId());
			ditService.doMigration();//starts Migration process.
			
			return new ModelAndView("redirect:/module/dataimporttool/status.page");
		}
}

{'fraction_non_alphanumeric': 0.09039961013645224, 'fraction_numerical': 0.0012183235867446393, 'mean_word_length': 4.749299719887955, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '23172', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1091, 'n_words': 301}