<commit_before>package edu.asu.conceptpower.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import edu.asu.conceptpower.core.ConceptEntry;
import edu.asu.conceptpower.core.IConceptManager;
import edu.asu.conceptpower.wrapper.ConceptEntryWrapper;
import edu.asu.conceptpower.wrapper.impl.ConceptEntryWrapperCreator;

/**
 * This class provides all the required methods for deleting a concept
 * 
 * @author Chetan
 * 
 */
@Controller
public class ConceptDeleteController {

	@Autowired
	private IConceptManager conceptManager;

	@Autowired
	private ConceptEntryWrapperCreator wrapperCreator;

	/**
	 * This method provides details of a concept to be deleted for concept
	 * delete page
	 * 
	 * @param conceptid
	 *            ID of a concept to be deleted
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to concept delete page
	 */
	@RequestMapping(value = "auth/conceptlist/deleteconcept/{conceptid}", method = RequestMethod.GET)
	public String prepareDeleteConcept(@PathVariable("conceptid") String conceptid, ModelMap model) {
		ConceptEntry concept = conceptManager.getConceptEntry(conceptid);
		model.addAttribute("word", concept.getWord());
		model.addAttribute("description", concept.getDescription());
		model.addAttribute("conceptId", concept.getId());
		model.addAttribute("wordnetId", concept.getWordnetId());
		model.addAttribute("pos", concept.getPos());
		model.addAttribute("conceptList", concept.getConceptList());
		model.addAttribute("type", concept.getTypeId());
		model.addAttribute("equal", concept.getEqualTo());
		model.addAttribute("similar", concept.getSimilarTo());
		model.addAttribute("user", concept.getModified());
		model.addAttribute("modified", concept.getModified());

		return "/auth/conceptlist/deleteconcept";
	}

	/**
	 * This method returns user to a particular concept list page after the user
	 * cancels concept delete operation
	 * 
	 * @param conceptList
	 *            concept list name where user has to redirected
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to a particular concept list
	 */
	@RequestMapping(value = "auth/concepts/canceldelete/{conceptList}", method = RequestMethod.GET)
	public String cancelDelete(@PathVariable("conceptList") String conceptList,
			ModelMap model) {
		List<ConceptEntry> founds = conceptManager
				.getConceptListEntries(conceptList);

		List<ConceptEntryWrapper> foundConcepts = wrapperCreator
				.createWrappers(founds != null ? founds
						.toArray(new ConceptEntry[founds.size()])
						: new ConceptEntry[0]);

		model.addAttribute("result", foundConcepts);
		return "/auth/conceptlist/concepts";
	}

	/**
	 * This method deletes a concept
	 * 
	 * @param id
	 *            Concept ID to be deleted
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to a particular concept list page
	 */
	@RequestMapping(value = "auth/conceptlist/deleteconceptconfirm/{id}", method = RequestMethod.GET)
	public String confirmlDelete(@PathVariable("id") String id, ModelMap model) {
		ConceptEntry concept = conceptManager.getConceptEntry(id);

		concept.setDeleted(true);
		// set modified and user details
		conceptManager.storeModifiedConcept(concept);

		List<ConceptEntry> founds = conceptManager
				.getConceptListEntries(concept.getConceptList());

		List<ConceptEntryWrapper> foundConcepts = wrapperCreator
				.createWrappers(founds != null ? founds
						.toArray(new ConceptEntry[founds.size()])
						: new ConceptEntry[0]);

		model.addAttribute("result", foundConcepts);
		return "/auth/conceptlist/concepts";
	}
	
	@RequestMapping(value = "auth/conceptlist/deleteconcepts/{id}", method = RequestMethod.GET)
    public String deleteConcept(@PathVariable("id") String id, ModelMap model) {
        ConceptEntry concept = conceptManager.getConceptEntry(id);
        concept.setDeleted(true);
        conceptManager.storeModifiedConcept(concept);
        return "welcome";
    }
	
}<commit_msg>Formatting changes<commit_after>package edu.asu.conceptpower.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import edu.asu.conceptpower.core.ConceptEntry;
import edu.asu.conceptpower.core.IConceptManager;
import edu.asu.conceptpower.wrapper.ConceptEntryWrapper;
import edu.asu.conceptpower.wrapper.impl.ConceptEntryWrapperCreator;

/**
 * This class provides all the required methods for deleting a concept
 * 
 * @author Chetan
 * 
 */
@Controller
public class ConceptDeleteController {

	@Autowired
	private IConceptManager conceptManager;

	@Autowired
	private ConceptEntryWrapperCreator wrapperCreator;

	/**
	 * This method provides details of a concept to be deleted for concept
	 * delete page
	 * 
	 * @param conceptid
	 *            ID of a concept to be deleted
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to concept delete page
	 */
	@RequestMapping(value = "auth/conceptlist/deleteconcept/{conceptid}", method = RequestMethod.GET)
	public String prepareDeleteConcept(@PathVariable("conceptid") String conceptid, ModelMap model) {
		ConceptEntry concept = conceptManager.getConceptEntry(conceptid);
		model.addAttribute("word", concept.getWord());
		model.addAttribute("description", concept.getDescription());
		model.addAttribute("conceptId", concept.getId());
		model.addAttribute("wordnetId", concept.getWordnetId());
		model.addAttribute("pos", concept.getPos());
		model.addAttribute("conceptList", concept.getConceptList());
		model.addAttribute("type", concept.getTypeId());
		model.addAttribute("equal", concept.getEqualTo());
		model.addAttribute("similar", concept.getSimilarTo());
		model.addAttribute("user", concept.getModified());
		model.addAttribute("modified", concept.getModified());

		return "/auth/conceptlist/deleteconcept";
	}

	/**
	 * This method returns user to a particular concept list page after the user
	 * cancels concept delete operation
	 * 
	 * @param conceptList
	 *            concept list name where user has to redirected
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to a particular concept list
	 */
	@RequestMapping(value = "auth/concepts/canceldelete/{conceptList}", method = RequestMethod.GET)
	public String cancelDelete(@PathVariable("conceptList") String conceptList,
			ModelMap model) {
		List<ConceptEntry> founds = conceptManager
				.getConceptListEntries(conceptList);

		List<ConceptEntryWrapper> foundConcepts = wrapperCreator
				.createWrappers(founds != null ? founds
						.toArray(new ConceptEntry[founds.size()])
						: new ConceptEntry[0]);

		model.addAttribute("result", foundConcepts);
		return "/auth/conceptlist/concepts";
	}

	/**
	 * This method deletes a concept
	 * 
	 * @param id
	 *            Concept ID to be deleted
	 * @param model
	 *            A generic model holder for Servlet
	 * @return String value to redirect user to a particular concept list page
	 */
	@RequestMapping(value = "auth/conceptlist/deleteconceptconfirm/{id}", method = RequestMethod.GET)
	public String confirmlDelete(@PathVariable("id") String id, ModelMap model) {
		ConceptEntry concept = conceptManager.getConceptEntry(id);

		concept.setDeleted(true);
		// set modified and user details
		conceptManager.storeModifiedConcept(concept);

		List<ConceptEntry> founds = conceptManager
				.getConceptListEntries(concept.getConceptList());

		List<ConceptEntryWrapper> foundConcepts = wrapperCreator
				.createWrappers(founds != null ? founds
						.toArray(new ConceptEntry[founds.size()])
						: new ConceptEntry[0]);

		model.addAttribute("result", foundConcepts);
		return "/auth/conceptlist/concepts";
	}
	
    @RequestMapping(value = "auth/conceptlist/deleteconcepts/{id}", method = RequestMethod.GET)
    public String deleteConcept(@PathVariable("id") String id, ModelMap model) {
        ConceptEntry concept = conceptManager.getConceptEntry(id);
        concept.setDeleted(true);
        conceptManager.storeModifiedConcept(concept);
        return "welcome";
    }
	
}
{'fraction_non_alphanumeric': 0.10473588342440801, 'fraction_numerical': 0.0004553734061930783, 'mean_word_length': 4.620601407549584, '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': '3232725', 'n_tokens_mistral': 2647, 'n_tokens_neox': 2377, 'n_words': 585}