<commit_before>package model.xml;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.naming.NameNotFoundException;

import controller.*;

import model.Field;
import model.Invitation;
import model.Project;
import model.Resource;
import model.ResourceType;
import model.Task;
import model.TaskTimings;
import model.TaskType;
import model.User;
import model.UserType;
import model.repositories.RepositoryManager;

import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import exception.AssetAllocatedException;
import exception.AssetConstraintFullException;
import exception.AssetTypeNotRequiredException;
import exception.BusinessRule1Exception;
import exception.BusinessRule2Exception;
import exception.BusinessRule3Exception;
import exception.DependencyCycleException;
import exception.EmptyStringException;
import exception.IllegalStateCallException;
import exception.IllegalStateChangeException;
import exception.InvitationInvitesOwnerException;
import exception.InvitationNotPendingException;
import exception.BadAllocationTimingException;
import exception.NonExistingTypeSelected;
import exception.NotAvailableException;
import exception.TimeException;
import exception.UnknownStateException;
import exception.WrongFieldsForChosenTypeException;
import exception.WrongUserForTaskTypeException;

/**
 * Usage: Make new XMLParser object and pass along the file location. 
 * Ask the object to Parse() and it gives back the user.
 */
public class DataXMLDAO {
	private XMLParser parser;
	RepositoryManager manager;
	private DispatchController controller;
	
	private HashMap<String, Project> projectMap = new HashMap<String, Project>();
	
	private HashMap<String, Task> taskMap = new HashMap<String, Task>();
	private LinkedHashMap<Task, String> stateMap = new LinkedHashMap<Task, String>();
	
	private HashMap<String, Resource> resourceMap = new HashMap<String, Resource>();
	private Map<String,User> users = new HashMap<String,User>();
	
	Map<String, TaskType> taskTypeMap = null;
	Map<String, ResourceType> resourceTypeMap = null;
	Map<String, UserType> userTypeMap = null;
	
	private Boolean ENABLE_DEBUG = true;
	
	/**
	 * Top Secret Debugging Tool!<commit_msg>Oeps, gij moest terug naar false, stouterik!<commit_after>package model.xml;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.naming.NameNotFoundException;

import controller.*;

import model.Field;
import model.Invitation;
import model.Project;
import model.Resource;
import model.ResourceType;
import model.Task;
import model.TaskTimings;
import model.TaskType;
import model.User;
import model.UserType;
import model.repositories.RepositoryManager;

import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import exception.AssetAllocatedException;
import exception.AssetConstraintFullException;
import exception.AssetTypeNotRequiredException;
import exception.BusinessRule1Exception;
import exception.BusinessRule2Exception;
import exception.BusinessRule3Exception;
import exception.DependencyCycleException;
import exception.EmptyStringException;
import exception.IllegalStateCallException;
import exception.IllegalStateChangeException;
import exception.InvitationInvitesOwnerException;
import exception.InvitationNotPendingException;
import exception.BadAllocationTimingException;
import exception.NonExistingTypeSelected;
import exception.NotAvailableException;
import exception.TimeException;
import exception.UnknownStateException;
import exception.WrongFieldsForChosenTypeException;
import exception.WrongUserForTaskTypeException;

/**
 * Usage: Make new XMLParser object and pass along the file location. 
 * Ask the object to Parse() and it gives back the user.
 */
public class DataXMLDAO {
	private XMLParser parser;
	RepositoryManager manager;
	private DispatchController controller;
	
	private HashMap<String, Project> projectMap = new HashMap<String, Project>();
	
	private HashMap<String, Task> taskMap = new HashMap<String, Task>();
	private LinkedHashMap<Task, String> stateMap = new LinkedHashMap<Task, String>();
	
	private HashMap<String, Resource> resourceMap = new HashMap<String, Resource>();
	private Map<String,User> users = new HashMap<String,User>();
	
	Map<String, TaskType> taskTypeMap = null;
	Map<String, ResourceType> resourceTypeMap = null;
	Map<String, UserType> userTypeMap = null;
	
	private Boolean ENABLE_DEBUG = false;
	
	/**
	 * Top Secret Debugging Tool!
{'fraction_non_alphanumeric': 0.08313492063492063, 'fraction_numerical': 0.002380952380952381, 'mean_word_length': 7.091492776886035, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7466799', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1349, 'n_words': 369}