Inheritance: XML_Node_Base_Type
 /// <summary> Constructor for a new instance of the Subject_Info_Name class </summary>
 public Subject_Info_Name()
 {
     nameInfo = new Name_Info();
 }
        /// <summary> Saves the data rendered by this element to the provided bibliographic object during postback </summary>
        /// <param name="Bib"> Object into which to save the user's data, entered into the html rendered by this element </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            bool main_is_found = false;
            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf("form_name_type_") == 0)
                {
                    string type = HttpContext.Current.Request.Form[thisKey].Trim();
                    string diff = thisKey.Replace("form_name_type_", "");
                    string main = HttpContext.Current.Request.Form["form_name_main_" + diff].Trim();
                    string full = HttpContext.Current.Request.Form["form_name_full_" + diff ].Trim();
                    string given = HttpContext.Current.Request.Form["form_name_given_" + diff].Trim();
                    string family = HttpContext.Current.Request.Form["form_name_family_" + diff].Trim();
                    string display = HttpContext.Current.Request.Form["form_name_display_" + diff].Trim();
                    string terms = HttpContext.Current.Request.Form["form_name_terms_" + diff].Trim();
                    string dates = HttpContext.Current.Request.Form["form_name_dates_" + diff].Trim();
                    string desc = HttpContext.Current.Request.Form["form_name_desc_" + diff].Trim();
                    string affiliation = HttpContext.Current.Request.Form["form_name_affiliation_" + diff].Trim();
                    string role1 = HttpContext.Current.Request.Form["form_name_role1_" + diff].Trim();
                    string role2 = HttpContext.Current.Request.Form["form_name_role2_" + diff].Trim();
                    string role3 = HttpContext.Current.Request.Form["form_name_role3_" + diff].Trim();

                    if ((full.Length > 0) || (given.Length > 0) || (family.Length > 0))
                    {
                        Name_Info newName;
                        if ((main == "main") && ( !main_is_found ))
                        {
                            newName = Bib.Bib_Info.Main_Entity_Name;
                            main_is_found = true;
                        }
                        else
                        {
                            newName = new Name_Info();
                            Bib.Bib_Info.Add_Named_Entity(newName);
                        }

                        switch (type)
                        {
                            case "corporate":
                                newName.Name_Type = Name_Info_Type_Enum.corporate;
                                break;

                            case "conference":
                                newName.Name_Type = Name_Info_Type_Enum.conference;
                                break;

                            default:
                                newName.Name_Type = Name_Info_Type_Enum.personal;
                                break;
                        }
                        newName.Full_Name = full;
                        if (newName.Name_Type == Name_Info_Type_Enum.personal)
                        {
                            newName.Given_Name = given;
                            newName.Family_Name = family;
                            newName.Display_Form = display;
                            newName.Terms_Of_Address = terms;
                        }

                        newName.Dates = dates;
                        newName.Affiliation = affiliation;
                        newName.Description = desc;

                        if (role1.Length > 0)
                            newName.Add_Role(role1);
                        if (role2.Length > 0)
                            newName.Add_Role(role2);
                        if (role3.Length > 0)
                            newName.Add_Role(role3);

                    }
                }
            }
        }
 internal void Set_Internal_Name(Name_Info NewName)
 {
     nameInfo = NewName;
 }
        /// <summary> Adds a name (creator) to this related item </summary>
        /// <param name="Name"> Name to associate with this related item </param>
        public void Add_Name(Name_Info Name)
        {
            if (names == null)
                names = new List<Name_Info>();

            names.Add(Name);
        }
        /// <summary> Create a test digital resource item  </summary>       
        /// <param name="directory">Directory for the package source directory</param>
        /// <returns>Fully built test bib package</returns>
        public static SobekCM_Item Create(string directory)
        {
            SobekCM_Item testPackage = new SobekCM_Item();

            // Add all the METS header information
            testPackage.METS_Header.Create_Date = new DateTime(2007, 1, 1);
            testPackage.METS_Header.Modify_Date = DateTime.Now;
            testPackage.METS_Header.Creator_Individual = "Mark Sullivan";
            testPackage.METS_Header.Add_Creator_Individual_Notes("Programmer of new SobekCM.Resource_Object");
            testPackage.METS_Header.Add_Creator_Individual_Notes("Adding coordinates");
            testPackage.METS_Header.Creator_Organization = "University of Florida";
            testPackage.METS_Header.Creator_Software = "SobekCM Bib Package Test";
            testPackage.METS_Header.RecordStatus_Enum = METS_Record_Status.COMPLETE;
            testPackage.METS_Header.Add_Creator_Org_Notes("This test package was done to test DLCs new METS package");

            // Add all the MODS elements
            Abstract_Info testAbstract = testPackage.Bib_Info.Add_Abstract("This is a sample abstract", "en");
            testPackage.Bib_Info.Add_Abstract("Tämä on esimerkki abstrakteja", "fin");
            testAbstract.Display_Label = "Summary Abstract";
            testAbstract.Type = "summary";

            testPackage.Bib_Info.Access_Condition.Text = "All rights are reserved by source institution.";
            testPackage.Bib_Info.Access_Condition.Language = "en";
            testPackage.Bib_Info.Access_Condition.Type = "restrictions on use";
            testPackage.Bib_Info.Access_Condition.Display_Label = "Rights";

            testPackage.Bib_Info.Add_Identifier("000123234", "OCLC", "Electronic OCLC");
            testPackage.Bib_Info.Add_Identifier("182-asdsd-28k", "DOI");

            testPackage.Bib_Info.Add_Language("English", String.Empty, "en");
            testPackage.Bib_Info.Add_Language("Finnish");
            testPackage.Bib_Info.Add_Language(String.Empty, "ita", String.Empty);

            testPackage.Bib_Info.Location.Holding_Code = "MVS";
            testPackage.Bib_Info.Location.Holding_Name = "From the Private Library of Mark Sullivan";
            testPackage.Bib_Info.Location.PURL = "http://www.uflib.ufl.edu/ufdc/?b=CA00000000";
            testPackage.Bib_Info.Location.Other_URL = "http://www.fnhm.edu";
            testPackage.Bib_Info.Location.Other_URL_Display_Label = "Specimen Information";
            testPackage.Bib_Info.Location.Other_URL_Note = "Specimen FLAS 125342 Database";
            testPackage.Bib_Info.Location.EAD_URL = "http://digital.uflib.ufl.edu/";
            testPackage.Bib_Info.Location.EAD_Name = "Digital Library Center Finding Guide";

            testPackage.Bib_Info.Main_Entity_Name.Name_Type = Name_Info_Type_Enum.Personal;
            testPackage.Bib_Info.Main_Entity_Name.Full_Name = "Brown, B.F.";
            testPackage.Bib_Info.Main_Entity_Name.Terms_Of_Address = "Dr.";
            testPackage.Bib_Info.Main_Entity_Name.Display_Form = "B.F. Brown";
            testPackage.Bib_Info.Main_Entity_Name.Affiliation = "Chemistry Dept., American University";
            testPackage.Bib_Info.Main_Entity_Name.Description = "Chemistry Professor Emeritus";
            testPackage.Bib_Info.Main_Entity_Name.Add_Role("Author");

            Zoological_Taxonomy_Info taxonInfo = new Zoological_Taxonomy_Info();
            testPackage.Add_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY, taxonInfo);
            taxonInfo.Scientific_Name = "Ctenomys sociabilis";
            taxonInfo.Higher_Classification = "Animalia; Chordata; Vertebrata; Mammalia; Theria; Eutheria; Rodentia; Hystricognatha; Hystricognathi; Ctenomyidae; Ctenomyini; Ctenomys";
            taxonInfo.Kingdom = "Animalia";
            taxonInfo.Phylum = "Chordata";
            taxonInfo.Class = "Mammalia";
            taxonInfo.Order = "Rodentia";
            taxonInfo.Family = "Ctenomyidae";
            taxonInfo.Genus = "Ctenomys";
            taxonInfo.Specific_Epithet = "sociabilis";
            taxonInfo.Taxonomic_Rank = "species";
            taxonInfo.Common_Name = "Social Tuco-Tuco";

            Name_Info name1 = new Name_Info();
            name1.Name_Type = Name_Info_Type_Enum.Personal;
            name1.Given_Name = "John Paul";
            name1.Terms_Of_Address = "Pope; II";
            name1.Dates = "1920-2002";
            name1.User_Submitted = true;
            testPackage.Bib_Info.Add_Named_Entity(name1);

            Name_Info name2 = new Name_Info();
            name2.Name_Type = Name_Info_Type_Enum.Conference;
            name2.Full_Name = "Paris Peace Conference (1919-1920)";
            name2.Dates = "1919-1920";
            testPackage.Bib_Info.Add_Named_Entity(name2);

            Name_Info name3 = new Name_Info();
            name3.Name_Type = Name_Info_Type_Enum.Corporate;
            name3.Full_Name = "United States -- Court of Appeals (2nd Court)";
            testPackage.Bib_Info.Add_Named_Entity(name3);

            Name_Info name4 = new Name_Info();
            name4.Name_Type = Name_Info_Type_Enum.Personal;
            name4.Full_Name = "Wilson, Mary";
            name4.Display_Form = "Mary 'Weels' Wilson";
            name4.Given_Name = "Mary";
            name4.Family_Name = "Wilson";
            name4.ID = "NAM4";
            name4.Terms_Of_Address = "2nd";
            name4.Add_Role("illustrator");
            name4.Add_Role("cartographer");
            testPackage.Bib_Info.Add_Named_Entity(name4);

            Name_Info donor = new Name_Info();
            donor.Name_Type = Name_Info_Type_Enum.Personal;
            donor.Full_Name = "Livingston, Arthur";
            donor.Description = "Gift in honor of Arthur Livingston";
            donor.Terms_Of_Address = "3rd";
            donor.Add_Role("honoree", String.Empty);
            testPackage.Bib_Info.Donor = donor;

            testPackage.Bib_Info.Main_Title.NonSort = "The ";
            testPackage.Bib_Info.Main_Title.Title = "Man Who Would Be King";
            testPackage.Bib_Info.Main_Title.Subtitle = "The story of succession in England";

            Title_Info title1 = new Title_Info("homme qui voulut être roi", Title_Type_Enum.Translated);
            title1.NonSort = "L'";
            title1.Language = "fr";
            testPackage.Bib_Info.Add_Other_Title(title1);

            Title_Info title2 = new Title_Info();
            title2.Title = "Man Who Be King";
            title2.Display_Label = "also known as";
            title2.NonSort = "The";
            title2.Title_Type = Title_Type_Enum.Alternative;
            testPackage.Bib_Info.Add_Other_Title(title2);

            Title_Info title3 = new Title_Info();
            title3.Title = "Great works of England";
            title3.Authority = "naf";
            title3.Add_Part_Name("Second Portion");
            title3.Add_Part_Number("2nd");
            title3.Title_Type = Title_Type_Enum.Uniform;
            title3.User_Submitted = true;
            testPackage.Bib_Info.Add_Other_Title(title3);

            testPackage.Bib_Info.Add_Note("Funded by the NEH", Note_Type_Enum.Funding);
            testPackage.Bib_Info.Add_Note("Based on a play which originally appeared in France as \"Un peu plus tard, un peu plus tôt\"").User_Submitted = true;
            testPackage.Bib_Info.Add_Note("Anne Baxter (Louise), Maria Perschy (Angela), Gustavo Rojo (Bill), Reginald Gilliam (Mr. Johnson), [Catherine Elliot?] (Aunt Sallie), Ben Tatar (waiter)", Note_Type_Enum.Performers, "Performed By");

            testPackage.Bib_Info.Origin_Info.Add_Place("New York", "nyu", "usa");
            testPackage.Bib_Info.Origin_Info.Date_Issued = "1992";
            testPackage.Bib_Info.Origin_Info.MARC_DateIssued_Start = "1992";
            testPackage.Bib_Info.Origin_Info.MARC_DateIssued_End = "1993";
            testPackage.Bib_Info.Origin_Info.Date_Copyrighted = "1999";
            testPackage.Bib_Info.Origin_Info.Edition = "2nd";

            Publisher_Info newPub = testPackage.Bib_Info.Add_Publisher("Published for the American Vacuum Society by the American Institute of Physics");
            newPub.Add_Place("New York, New York");
            newPub.User_Submitted = true;
            testPackage.Bib_Info.Add_Publisher("University of Florida Press House").Add_Place("Gainesville, FL");
            testPackage.Bib_Info.Add_Manufacturer("Addison Randly Publishing House");

            testPackage.Bib_Info.Original_Description.Extent = "1 sound disc (56 min.) : digital ; 3/4 in.";
            testPackage.Bib_Info.Original_Description.Add_Note("The sleeve of this sound disc was damaged in a fire");
            testPackage.Bib_Info.Original_Description.Add_Note("The disc has a moderate amount of scratches, but still plays");

            testPackage.Bib_Info.Series_Part_Info.Day = "18";
            testPackage.Bib_Info.Series_Part_Info.Day_Index = 18;
            testPackage.Bib_Info.Series_Part_Info.Month = "Syyskuu";
            testPackage.Bib_Info.Series_Part_Info.Month_Index = 9;
            testPackage.Bib_Info.Series_Part_Info.Year = "1992";
            testPackage.Bib_Info.Series_Part_Info.Year_Index = 1992;

            testPackage.Bib_Info.Series_Part_Info.Enum1 = "Volume 12";
            testPackage.Bib_Info.Series_Part_Info.Enum1_Index = 12;
            testPackage.Bib_Info.Series_Part_Info.Enum2 = "Issue 3";
            testPackage.Bib_Info.Series_Part_Info.Enum2_Index = 3;
            testPackage.Bib_Info.Series_Part_Info.Enum3 = "Part 1";
            testPackage.Bib_Info.Series_Part_Info.Enum3_Index = 1;

            testPackage.Behaviors.Serial_Info.Add_Hierarchy(1, 1992, "1992");
            testPackage.Behaviors.Serial_Info.Add_Hierarchy(2, 9, "Syyskuu");
            testPackage.Behaviors.Serial_Info.Add_Hierarchy(3, 18, "18");

            testPackage.Bib_Info.SeriesTitle.Title = "Shakespeare's most famous musicals";

            testPackage.Bib_Info.Add_Target_Audience("young adults");
            testPackage.Bib_Info.Add_Target_Audience("adolescent", "marctarget");

            testPackage.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Newspaper;

            // Add cartographic subject
            Subject_Info_Cartographics newCartographics = testPackage.Bib_Info.Add_Cartographics_Subject();
            newCartographics.Scale = "1:2000";
            newCartographics.Projection = "Conical Projection";
            newCartographics.Coordinates = "E 72°--E 148°/N 13°--N 18°";

            // Add hierarchical geographic subject
            Subject_Info_HierarchicalGeographic hierarchical = testPackage.Bib_Info.Add_Hierarchical_Geographic_Subject();
            hierarchical.Continent = "North America";
            hierarchical.Country = "United States of America";
            hierarchical.State = "Kansas";
            hierarchical.County = "Butler";
            hierarchical.City = "Augusta";

            // Add hierarchical geographic subject
            Subject_Info_HierarchicalGeographic hierarchical2 = testPackage.Bib_Info.Add_Hierarchical_Geographic_Subject();
            hierarchical2.Region = "Arctic Ocean";

            // Add hierarchical geographic subject
            Subject_Info_HierarchicalGeographic hierarchical3 = testPackage.Bib_Info.Add_Hierarchical_Geographic_Subject();
            hierarchical3.Island = "Puerto Rico";
            hierarchical3.Language = "English";
            hierarchical3.Province = "Provincial";
            hierarchical3.Territory = "Puerto Rico";
            hierarchical3.Area = "Intercontinental areas (Western Hemisphere)";

            // Add a name subject
            Subject_Info_Name subjname1 = testPackage.Bib_Info.Add_Name_Subject();
            subjname1.Authority = "lcsh";
            subjname1.Full_Name = "Garcia Lorca, Federico";
            subjname1.Dates = "1898-1936";
            subjname1.Add_Geographic("Russia");
            subjname1.Add_Geographic("Moscow");
            subjname1.Add_Genre("maps");
            subjname1.User_Submitted = true;

            // Add a title information subject
            Subject_Info_TitleInfo subjtitle1 = testPackage.Bib_Info.Add_Title_Subject();
            subjtitle1.Title_Type = Title_Type_Enum.Uniform;
            subjtitle1.Authority = "naf";
            subjtitle1.Title = "Missale Carnotense";

            // Add a standard subject
            Subject_Info_Standard subject1 = testPackage.Bib_Info.Add_Subject();
            subject1.Authority = "lcsh";
            subject1.Add_Topic("Real property");
            subject1.Add_Geographic("Mississippi");
            subject1.Add_Geographic("Tippah County");
            subject1.Add_Genre("Maps");

            // Add a standard subject
            Subject_Info_Standard subject2 = testPackage.Bib_Info.Add_Subject();
            subject2.Add_Occupation("Migrant laborers");
            subject2.Add_Genre("School district case files");

            // Add a standard subject
            Subject_Info_Standard subject3 = testPackage.Bib_Info.Add_Subject();
            subject3.Authority = "lctgm";
            subject3.Add_Topic("Educational buildings");
            subject3.Add_Geographic("Washington (D.C.)");
            subject3.Add_Temporal("1890-1910");

            // Add a standard subject
            Subject_Info_Standard subject4 = testPackage.Bib_Info.Add_Subject();
            subject4.Authority = "rvm";
            subject4.Language = "french";
            subject4.Add_Topic("Église catholique");
            subject4.Add_Topic("Histoire");
            subject4.Add_Temporal("20e siècle");

            // Add record information
            testPackage.Bib_Info.Record.Add_Catalog_Language(new Language_Info("English", "eng", "en"));
            testPackage.Bib_Info.Record.Add_Catalog_Language(new Language_Info("French", "fre", "fr"));
            testPackage.Bib_Info.Record.MARC_Creation_Date = "080303";
            testPackage.Bib_Info.Record.Add_MARC_Record_Content_Sources("FUG");
            testPackage.Bib_Info.Record.Record_Origin = "Imported from (OCLC)001213124";

            // Test the items which are in the non-MODS portion of the Bib_Info object
            testPackage.BibID = "MVS0000001";
            testPackage.VID = "00001";
            testPackage.Bib_Info.SortDate = 1234;
            testPackage.Bib_Info.SortTitle = "MAN WHO WOULD BE KING";
            testPackage.Bib_Info.Add_Temporal_Subject(1990, 2002, "Recent history");
            testPackage.Bib_Info.Add_Temporal_Subject(1990, 2002, "Lähihistoria");
            testPackage.Bib_Info.Source.Code = "UF";
            testPackage.Bib_Info.Source.Statement = "University of Florida";

            // Add an affiliation
            Affiliation_Info affiliation1 = new Affiliation_Info();
            affiliation1.University = "University of Florida";
            affiliation1.Campus = "Gainesville Campus";
            affiliation1.College = "College of Engineering";
            affiliation1.Department = "Computer Engineering Department";
            affiliation1.Unit = "Robotics";
            affiliation1.Name_Reference = "NAM4";
            testPackage.Bib_Info.Add_Affiliation(affiliation1);

            // Add a related item
            Related_Item_Info relatedItem1 = new Related_Item_Info();
            relatedItem1.SobekCM_ID = "UF00001234";
            relatedItem1.Relationship = Related_Item_Type_Enum.Preceding;
            relatedItem1.Publisher = "Gainesville Sun Publishing House";
            relatedItem1.Add_Note(new Note_Info("Digitized with funding from NEH", Note_Type_Enum.Funding));
            relatedItem1.Add_Note(new Note_Info("Gainesville Bee was the precursor to this item"));
            relatedItem1.Main_Title.NonSort = "The";
            relatedItem1.Main_Title.Title = "Gainesville Bee";
            relatedItem1.Add_Identifier("01234353", "oclc");
            relatedItem1.Add_Identifier("002232311", "aleph");
            Name_Info ri_name = new Name_Info();
            ri_name.Full_Name = "Hills, Bryan";
            ri_name.Terms_Of_Address = "Mr.";
            ri_name.Name_Type = Name_Info_Type_Enum.Personal;
            ri_name.Add_Role("author");
            relatedItem1.Add_Name(ri_name);
            relatedItem1.URL = @"http://www.uflib.ufl.edu/ufdc/?b=UF00001234";
            relatedItem1.URL_Display_Label = "Full Text";
            testPackage.Bib_Info.Add_Related_Item(relatedItem1);

            // Add another related item
            Related_Item_Info relatedItem2 = new Related_Item_Info();
            relatedItem2.Relationship = Related_Item_Type_Enum.Succeeding;
            relatedItem2.SobekCM_ID = "UF00009999";
            relatedItem2.Main_Title.NonSort = "The";
            relatedItem2.Main_Title.Title = "Daily Sun";
            relatedItem2.Add_Identifier("0125437", "oclc");
            relatedItem2.Add_Note("Name change occured in Fall 1933");
            relatedItem2.Start_Date = "Fall 1933";
            relatedItem2.End_Date = "December 31, 1945";
            testPackage.Bib_Info.Add_Related_Item(relatedItem2);

            // Add some processing parameters
            testPackage.Behaviors.Add_Aggregation("JUV");
            testPackage.Behaviors.Add_Aggregation("DLOC");
            testPackage.Behaviors.Add_Aggregation("DLOSA1");
            testPackage.Behaviors.Add_Aggregation("ALICE");
            testPackage.Behaviors.Add_Aggregation("ARTE");

            testPackage.Web.GUID = "GUID!";
            testPackage.Behaviors.Add_Wordmark("DLOC");
            testPackage.Behaviors.Add_Wordmark("UFSPEC");
            testPackage.Behaviors.Main_Thumbnail = "00001thm.jpg";

            // Add some downloads
            testPackage.Divisions.Download_Tree.Add_File("MVS_Complete.PDF");
            testPackage.Divisions.Download_Tree.Add_File("MVS_Complete.MP2");
            testPackage.Divisions.Download_Tree.Add_File("MVS_Part1.MP2");
            testPackage.Divisions.Download_Tree.Add_File("MVS_Part1.PDF");

            // Add some coordinate information
            GeoSpatial_Information geoSpatial = new GeoSpatial_Information();
            testPackage.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoSpatial);
            geoSpatial.Add_Point(29.530151, -82.301459, "Lake Wauberg");
            geoSpatial.Add_Point(29.634352, -82.350640, "Veterinary School");
            Coordinate_Polygon polygon = new Coordinate_Polygon();
            polygon.Label = "University of Florida Campus";
            polygon.Add_Edge_Point(new Coordinate_Point(29.651435, -82.339869, String.Empty));
            polygon.Add_Edge_Point(new Coordinate_Point(29.641216, -82.340298, String.Empty));
            polygon.Add_Edge_Point(new Coordinate_Point(29.629503, -82.371969, String.Empty));
            polygon.Add_Edge_Point(new Coordinate_Point(29.649645, -82.371712, String.Empty));
            polygon.Add_Inner_Point(29.649794, -82.351971, "Stadium");
            polygon.Add_Inner_Point(29.650988, -82.341156, "Library");
            geoSpatial.Add_Polygon(polygon);
            Coordinate_Line line = new Coordinate_Line();
            line.Label = "Waldo Road";
            line.Add_Point(29.652852, -82.310944, "Gainesville");
            line.Add_Point(29.716681, -82.268372, String.Empty);
            line.Add_Point(29.791494, -82.167778, "Waldo");
            geoSpatial.Add_Line(line);

            // Add some performing arts information
            Performing_Arts_Info partInfo = new Performing_Arts_Info();
            testPackage.Add_Metadata_Module("PerformingArts", partInfo);
            partInfo.Performance = "Hamlet";
            partInfo.Performance_Date = "August 12, 1923";
            Performer performer1 = partInfo.Add_Performer("Sullivan, Mark");
            performer1.Sex = "M";
            performer1.LifeSpan = "1873-";
            performer1.Occupation = "actor";
            performer1.Title = "Mr.";

            Performer performer2 = partInfo.Add_Performer("Waldbart, Julia");
            performer2.Sex = "F";
            performer2.LifeSpan = "1876-";
            performer2.Occupation = "actress";
            performer2.Title = "Mrs.";

            // Add some oral history information
            Oral_Interview_Info oralInfo = new Oral_Interview_Info();
            testPackage.Add_Metadata_Module(  "OralInterview", oralInfo);
            oralInfo.Interviewee = "Edwards, Herm";
            oralInfo.Interviewer = "Proctor, Samual";

            // Add some learning object resource information
            LearningObjectMetadata lomInfo = new LearningObjectMetadata();
            testPackage.Add_Metadata_Module( GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo );
            lomInfo.AggregationLevel = AggregationLevelEnum.level3;
            lomInfo.Status = StatusEnum.draft;
            LOM_System_Requirements lomReq1 = new LOM_System_Requirements();
            lomReq1.RequirementType = RequirementTypeEnum.operating_system;
            lomReq1.Name.Value = "Windows";
            lomReq1.MinimumVersion = "Windows XP";
            lomReq1.MaximumVersion = "Windows 7";
            lomInfo.Add_SystemRequirements(lomReq1);
            LOM_System_Requirements lomReq2 = new LOM_System_Requirements();
            lomReq2.RequirementType = RequirementTypeEnum.software;
            lomReq2.Name.Value = "Java SDK";
            lomReq2.MinimumVersion = "1.7.1";
            lomReq2.MaximumVersion = "2.09";
            lomInfo.Add_SystemRequirements(lomReq2);
            lomInfo.InteractivityType = InteractivityTypeEnum.mixed;
            lomInfo.Add_LearningResourceType("exercise");
            lomInfo.Add_LearningResourceType("Tutorials", "encdlwebpedagogicaltype");
            lomInfo.InteractivityLevel = InteractivityLevelEnum.high;
            lomInfo.Add_IntendedEndUserRole(IntendedEndUserRoleEnum.learner);
            lomInfo.Add_Context("Undergraduate lower division", "enclearningcontext");
            lomInfo.Add_Context("15", "grade");
            lomInfo.Add_Context("16", "grade");
            lomInfo.Add_Context("5", "group");
            lomInfo.Add_TypicalAgeRange("suitable for children over 7", "en");
            lomInfo.Add_TypicalAgeRange("2-8");
            lomInfo.DifficultyLevel = DifficultyLevelEnum.medium;
            lomInfo.TypicalLearningTime = "PT45M";

            LOM_Classification lomClassification1 = new LOM_Classification();
            lomInfo.Add_Classification(lomClassification1);
            lomClassification1.Purpose.Value = "Discipline";
            LOM_TaxonPath lomTaxonPath1 = new LOM_TaxonPath();
            lomClassification1.Add_TaxonPath(lomTaxonPath1);
            lomTaxonPath1.Add_SourceName("ARIADNE");
            LOM_Taxon lomTaxon1 = new LOM_Taxon();
            lomTaxonPath1.Add_Taxon(lomTaxon1);
            lomTaxon1.ID = "BF120";
            lomTaxon1.Add_Entry("Work_History", "en");
            lomTaxon1.Add_Entry("Historie", "nl");
            LOM_Taxon lomTaxon2 = new LOM_Taxon();
            lomTaxonPath1.Add_Taxon(lomTaxon2);
            lomTaxon2.ID = "BF120.1";
            lomTaxon2.Add_Entry("American Work_History", "en");
            LOM_Taxon lomTaxon3 = new LOM_Taxon();
            lomTaxonPath1.Add_Taxon(lomTaxon3);
            lomTaxon3.ID = "BF120.1.4";
            lomTaxon3.Add_Entry("American Civil War", "en");

            LOM_Classification lomClassification2 = new LOM_Classification();
            lomInfo.Add_Classification(lomClassification2);
            lomClassification2.Purpose.Value = "Educational Objective";

            LOM_TaxonPath lomTaxonPath2 = new LOM_TaxonPath();
            lomClassification2.Add_TaxonPath(lomTaxonPath2);
            lomTaxonPath2.Add_SourceName("Common Core Standards", "en");
            LOM_Taxon lomTaxon4 = new LOM_Taxon();
            lomTaxonPath2.Add_Taxon(lomTaxon4);
            lomTaxon4.ID = "CCS.Math.Content";
            LOM_Taxon lomTaxon5 = new LOM_Taxon();
            lomTaxonPath2.Add_Taxon(lomTaxon5);
            lomTaxon5.ID = "3";
            lomTaxon5.Add_Entry("Grade 3", "en");
            LOM_Taxon lomTaxon6 = new LOM_Taxon();
            lomTaxonPath2.Add_Taxon(lomTaxon6);
            lomTaxon6.ID = "OA";
            lomTaxon6.Add_Entry("Operations and Algebraic Thinking", "en");
            LOM_Taxon lomTaxon7 = new LOM_Taxon();
            lomTaxonPath2.Add_Taxon(lomTaxon7);
            lomTaxon7.ID = "A";
            lomTaxon7.Add_Entry("Represent and solve problems involving multiplication and division.", "en");
            LOM_Taxon lomTaxon8 = new LOM_Taxon();
            lomTaxonPath2.Add_Taxon(lomTaxon8);
            lomTaxon8.ID = "3";
            lomTaxon8.Add_Entry("Use multiplication and division within 100 to solve word problems in situations involving equal groups, arrays, and measurement quantities, e.g., by using drawings and equations with a symbol for the unknown number to represent the problem.", "en");

            LOM_TaxonPath lomTaxonPath3 = new LOM_TaxonPath();
            lomClassification2.Add_TaxonPath(lomTaxonPath3);
            lomTaxonPath3.Add_SourceName("Common Core Standards", "en");
            LOM_Taxon lomTaxon14 = new LOM_Taxon();
            lomTaxonPath3.Add_Taxon(lomTaxon14);
            lomTaxon14.ID = "CCS.Math.Content";
            LOM_Taxon lomTaxon15 = new LOM_Taxon();
            lomTaxonPath3.Add_Taxon(lomTaxon15);
            lomTaxon15.ID = "3";
            lomTaxon15.Add_Entry("Grade 3", "en");
            LOM_Taxon lomTaxon16 = new LOM_Taxon();
            lomTaxonPath3.Add_Taxon(lomTaxon16);
            lomTaxon16.ID = "OA";
            lomTaxon16.Add_Entry("Operations and Algebraic Thinking", "en");
            LOM_Taxon lomTaxon17 = new LOM_Taxon();
            lomTaxonPath3.Add_Taxon(lomTaxon17);
            lomTaxon17.ID = "A";
            lomTaxon17.Add_Entry("Represent and solve problems involving multiplication and division.", "en");
            LOM_Taxon lomTaxon18 = new LOM_Taxon();
            lomTaxonPath3.Add_Taxon(lomTaxon18);
            lomTaxon18.ID = "4";
            lomTaxon18.Add_Entry("Determine the unknown whole number in a multiplication or division equation relating three whole numbers. For example, determine the unknown number that makes the equation true in each of the equations 8 × ? = 48, 5 = _ ÷ 3, 6 × 6 = ?", "en");

            // Add some views and interfaces
            testPackage.Behaviors.Clear_Web_Skins();
            testPackage.Behaviors.Add_Web_Skin("dLOC");
            testPackage.Behaviors.Add_Web_Skin("UFDC");
            testPackage.Behaviors.Add_View(View_Enum.JPEG2000);
            testPackage.Behaviors.Add_View(View_Enum.JPEG);
            testPackage.Behaviors.Add_View(View_Enum.RELATED_IMAGES);
            testPackage.Behaviors.Add_View(View_Enum.HTML, "Full Document", "MVS001214.html");

            // Create the chapters and pages and link them
            Division_TreeNode chapter1 = new Division_TreeNode("Chapter", "First Chapter");
            Page_TreeNode page1 = new Page_TreeNode("First Page");
            Page_TreeNode page2 = new Page_TreeNode("Page 2");
            chapter1.Nodes.Add(page1);
            chapter1.Nodes.Add(page2);
            Division_TreeNode chapter2 = new Division_TreeNode("Chapter", "Last Chapter");
            Page_TreeNode page3 = new Page_TreeNode("Page 3");
            Page_TreeNode page4 = new Page_TreeNode("Last Page");
            chapter2.Nodes.Add(page3);
            chapter2.Nodes.Add(page4);
            testPackage.Divisions.Physical_Tree.Roots.Add(chapter1);
            testPackage.Divisions.Physical_Tree.Roots.Add(chapter2);

            // Create the files
            SobekCM_File_Info file1_1 = new SobekCM_File_Info("2000626_0001.jp2", 2120, 1100);
            SobekCM_File_Info file1_2 = new SobekCM_File_Info("2000626_0001.jpg", 630, 330);
            SobekCM_File_Info file1_3 = new SobekCM_File_Info("2000626_0001.tif");
            SobekCM_File_Info file2_1 = new SobekCM_File_Info("2000626_0002.jp2", 1754, 2453);
            SobekCM_File_Info file2_2 = new SobekCM_File_Info("2000626_0002.jpg", 630, 832);
            SobekCM_File_Info file2_3 = new SobekCM_File_Info("2000626_0002.tif");
            SobekCM_File_Info file3_1 = new SobekCM_File_Info("2000626_0003.jp2", 2321, 1232);
            SobekCM_File_Info file3_2 = new SobekCM_File_Info("2000626_0003.jpg", 630, 342);
            SobekCM_File_Info file3_3 = new SobekCM_File_Info("2000626_0003.tif");
            SobekCM_File_Info file4_1 = new SobekCM_File_Info("2000626_0004.jp2", 2145, 1024);
            SobekCM_File_Info file4_2 = new SobekCM_File_Info("2000626_0004.jpg", 630, 326);
            SobekCM_File_Info file4_3 = new SobekCM_File_Info("2000626_0004.tif");

            // Link the files to the pages
            page1.Files.Add(file1_1);
            page1.Files.Add(file1_2);
            page1.Files.Add(file1_3);
            page2.Files.Add(file2_1);
            page2.Files.Add(file2_2);
            page2.Files.Add(file2_3);
            page3.Files.Add(file3_1);
            page3.Files.Add(file3_2);
            page3.Files.Add(file3_3);
            page4.Files.Add(file4_1);
            page4.Files.Add(file4_2);
            page4.Files.Add(file4_3);

            // Add the DAITSS information
            DAITSS_Info daitssInfo = new DAITSS_Info();
            daitssInfo.Account = "FTU";
            daitssInfo.SubAccount = "CLAS";
            daitssInfo.Project = "UFDC";
            daitssInfo.toArchive = true;
            testPackage.Add_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY, daitssInfo);

            // Save this package
            testPackage.Source_Directory = directory;
            return testPackage;
        }
        private static void Add_Corporate_Name(Bibliographic_Info thisBibInfo, MARC_Record record, int tag, int name_type)
        {
            // Step through each instance of this tag
            foreach (MARC_Field thisRecord in record[tag])
            {
                if ((name_type != 3) || (thisRecord.Indicator2 == '3'))
                {
                    // Create the name object
                    Name_Info newName = new Name_Info();
                    newName.Name_Type = Name_Info_Type_Enum.Corporate;

                    // Only continue if there is an id in this record
                    if ((thisRecord.has_Subfield('a')) && (thisRecord['a'].ToUpper().IndexOf("PALMM") < 0))
                    {
                        newName.Full_Name = Remove_Trailing_Punctuation(thisRecord['a']);
                        if (thisRecord.has_Subfield('b'))
                        {
                            newName.Full_Name = newName.Full_Name + " -- " + Remove_Trailing_Punctuation(thisRecord['b']);
                        }
                        if (thisRecord.has_Subfield('c'))
                            newName.Description = thisRecord['c'];
                        if (thisRecord.has_Subfield('d'))
                            newName.Dates = Remove_Trailing_Punctuation(thisRecord['d']);
                        if (thisRecord.has_Subfield('e'))
                            newName.Add_Role(Remove_Trailing_Punctuation(thisRecord['e']));
                        if (thisRecord.has_Subfield('u'))
                            newName.Affiliation = Remove_Trailing_Punctuation(thisRecord['u']);

                        // Is there a relator code?
                        if (thisRecord.has_Subfield('4'))
                        {
                            // Get the relator code
                            string relatorcode = thisRecord['4'];
                            newName.Add_Role(relatorcode, "marcrelator", Name_Info_Role_Type_Enum.Code);
                        }

                        switch (name_type)
                        {
                            case 1:
                                thisBibInfo.Main_Entity_Name = newName;
                                break;

                            case 2:
                                thisBibInfo.Add_Named_Entity(newName);
                                break;

                            case 3:
                                thisBibInfo.Donor = newName;
                                break;

                            case 4:
                                Subject_Info_Name newNameSubj = new Subject_Info_Name();
                                newNameSubj.Set_Internal_Name(newName);
                                if (thisRecord.has_Subfield('v'))
                                    newNameSubj.Add_Genre(Remove_Trailing_Punctuation(thisRecord['v']));
                                if (thisRecord.has_Subfield('x'))
                                    newNameSubj.Add_Topic(Remove_Trailing_Punctuation(thisRecord['x']));
                                if (thisRecord.has_Subfield('y'))
                                    newNameSubj.Add_Temporal(Remove_Trailing_Punctuation(thisRecord['y']));
                                if (thisRecord.has_Subfield('z'))
                                    newNameSubj.Add_Geographic(Remove_Trailing_Punctuation(thisRecord['z']));
                                if (thisRecord.has_Subfield('2'))
                                    newNameSubj.Authority = thisRecord['2'];
                                switch (thisRecord.Indicator2)
                                {
                                    case '0':
                                        newNameSubj.Authority = "lcsh";
                                        break;

                                    case '1':
                                        newNameSubj.Authority = "lcshac";
                                        break;

                                    case '2':
                                        newNameSubj.Authority = "mesh";
                                        break;

                                    case '3':
                                        newNameSubj.Authority = "nal";
                                        break;

                                    case '5':
                                        newNameSubj.Authority = "csh";
                                        break;

                                    case '6':
                                        newNameSubj.Authority = "rvm";
                                        break;
                                }
                                break;
                        }
                    }
                }
            }
        }
        private static void Add_Personal_Name(Bibliographic_Info thisBibInfo, MARC_Record record, int tag, int name_type)
        {
            // Step through each instance of this tag
            foreach (MARC_Field thisRecord in record[tag])
            {
                // Create the name object
                Name_Info newName = new Name_Info();
                newName.Name_Type = Name_Info_Type_Enum.Personal;

                // Only continue if there is an id in this record
                if ((thisRecord.has_Subfield('a')) && (thisRecord['a'].ToUpper().IndexOf("PALMM") < 0))
                {
                    // Save the 'a' value
                    switch (thisRecord.Indicator1)
                    {
                        case '0':
                            newName.Given_Name = Remove_Trailing_Punctuation(thisRecord['a']);
                            newName.Full_Name = newName.Given_Name;
                            break;

                        case '1':
                            string tempName = Remove_Trailing_Punctuation(thisRecord['a']);
                            int tempCommaIndex = tempName.IndexOf(",");
                            if (tempCommaIndex > 0)
                            {
                                newName.Family_Name = tempName.Substring(0, tempCommaIndex).Trim();
                                newName.Given_Name = tempName.Substring(tempCommaIndex + 1).Trim();
                                newName.Full_Name = tempName;
                            }
                            else
                            {
                                newName.Family_Name = tempName;
                            }
                            break;

                        case '3':
                            newName.Family_Name = Remove_Trailing_Punctuation(thisRecord['a']);
                            newName.Full_Name = newName.Family_Name;
                            break;

                        default:
                            newName.Full_Name = Remove_Trailing_Punctuation(thisRecord['a']);
                            break;
                    }

                    if (thisRecord.has_Subfield('b'))
                        newName.Terms_Of_Address = thisRecord['b'];
                    if (thisRecord.has_Subfield('c'))
                    {
                        if (newName.Terms_Of_Address.Length > 0)
                        {
                            newName.Terms_Of_Address = newName.Terms_Of_Address + "; " + thisRecord['c'];
                        }
                        else
                        {
                            newName.Terms_Of_Address = thisRecord['c'];
                        }
                    }
                    if (thisRecord.has_Subfield('d'))
                        newName.Dates = Remove_Trailing_Punctuation(thisRecord['d']);
                    if (thisRecord.has_Subfield('e'))
                        newName.Add_Role(Remove_Trailing_Punctuation(thisRecord['e']));
                    if (thisRecord.has_Subfield('g'))
                        newName.Description = Remove_Trailing_Punctuation(thisRecord['g']);
                    if (thisRecord.has_Subfield('j'))
                    {
                        if (newName.Description.Length > 0)
                        {
                            newName.Description = newName.Description + "; " + thisRecord['j'];
                        }
                        else
                        {
                            newName.Description = thisRecord['j'];
                        }
                    }
                    if (thisRecord.has_Subfield('u'))
                        newName.Affiliation = Remove_Trailing_Punctuation(thisRecord['u']);
                    if (thisRecord.has_Subfield('q'))
                        newName.Display_Form = Remove_Trailing_Punctuation(thisRecord['q'].Replace("(", "").Replace(")", ""));

                    // Is there a relator code?
                    if (thisRecord.has_Subfield('4'))
                    {
                        // Get the relator code
                        string completeRelatorcode = thisRecord['4'];
                        string[] relatorCodesSplitter = completeRelatorcode.Split("|".ToCharArray());
                        foreach (string relatorcode in relatorCodesSplitter)
                        {
                            newName.Add_Role(relatorcode, "marcrelator", Name_Info_Role_Type_Enum.Code);
                        }
                    }

                    switch (name_type)
                    {
                        case 1:
                            thisBibInfo.Main_Entity_Name = newName;
                            break;

                        case 2:
                            thisBibInfo.Add_Named_Entity(newName);
                            break;

                        case 3:
                            thisBibInfo.Donor = newName;
                            break;

                        case 4:
                            Subject_Info_Name newNameSubj = new Subject_Info_Name();
                            newNameSubj.Set_Internal_Name(newName);
                            if (thisRecord.has_Subfield('v'))
                                newNameSubj.Add_Genre(Remove_Trailing_Punctuation(thisRecord['v']));
                            if (thisRecord.has_Subfield('x'))
                                newNameSubj.Add_Topic(Remove_Trailing_Punctuation(thisRecord['x']));
                            if (thisRecord.has_Subfield('y'))
                                newNameSubj.Add_Temporal(Remove_Trailing_Punctuation(thisRecord['y']));
                            if (thisRecord.has_Subfield('z'))
                                newNameSubj.Add_Geographic(Remove_Trailing_Punctuation(thisRecord['z']));
                            if (thisRecord.has_Subfield('2'))
                                newNameSubj.Authority = thisRecord['2'];
                            switch (thisRecord.Indicator2)
                            {
                                case '0':
                                    newNameSubj.Authority = "lcsh";
                                    break;

                                case '1':
                                    newNameSubj.Authority = "lcshac";
                                    break;

                                case '2':
                                    newNameSubj.Authority = "mesh";
                                    break;

                                case '3':
                                    newNameSubj.Authority = "nal";
                                    break;

                                case '5':
                                    newNameSubj.Authority = "csh";
                                    break;

                                case '6':
                                    newNameSubj.Authority = "rvm";
                                    break;
                            }
                            break;
                    }
                }
            }
        }
        /// <summary> Adds a bit of data to a bibliographic package using the mapping </summary>
        /// <param name="Package">Bibliographic package to receive the data</param>
        /// <param name="Data">Text of the data</param>
        /// <param name="Field">Mapped field</param>
        public static void Add_Data(SobekCM_Item Package, string Data, Mapped_Fields Field)
        {
            Data = Data.Trim();
            if (Data.Length == 0)
                return;

            // Everything depends on the field which is mapped
            switch (Field)
            {
                case Mapped_Fields.None:
                    // Do nothing, since no mapping exists
                    break;

                case Mapped_Fields.Abstract:
                    Package.Bib_Info.Add_Abstract(Data, "en");
                    break;
                case Mapped_Fields.Accession_Number:
                    Package.Bib_Info.Add_Identifier(Data, "Accession Number");
                    break;
                case Mapped_Fields.Alternate_Title:
                    Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.alternative);
                    break;
                case Mapped_Fields.Alternate_Title_Language:
                    List<Title_Info> otherTitles = Package.Bib_Info.Other_Titles.Where(ThisTitle => ThisTitle.Title_Type == Title_Type_Enum.alternative).ToList();
                    if (otherTitles.Count > 0)
                    {
                        otherTitles[otherTitles.Count - 1].Language = Data;
                    }
                    break;
                case Mapped_Fields.Attribution:
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.funding);
                    break;
                case Mapped_Fields.Aggregation_Code:
                    Package.Behaviors.Add_Aggregation(Data.ToUpper());
                    break;
                case Mapped_Fields.Classification:
                    Package.Bib_Info.Add_Classification(Data);
                    break;
                case Mapped_Fields.Classification_Authority:
                    if (Package.Bib_Info.Classifications_Count > 0)
                    {
                        Package.Bib_Info.Classifications[Package.Bib_Info.Classifications_Count - 1].Authority = Data;
                    }
                    break;
                case Mapped_Fields.Contributor:
                    Package.Bib_Info.Add_Named_Entity(new Name_Info(Data, "contributor"));
                    break;
                case Mapped_Fields.Creator:
                    Package.Bib_Info.Add_Named_Entity(new Name_Info(Data, "creator"));
                    break;
                case Mapped_Fields.Creator_Affiliation:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Affiliation = Data;
                    }
                    break;
                case Mapped_Fields.Creator_Dates:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Dates = Data;
                    }
                    break;
                case Mapped_Fields.Creator_Family_Name:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info lastNamedEntity = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if (lastNamedEntity.Family_Name.Length == 0)
                            lastNamedEntity.Family_Name = Data;
                        else
                        {
                            Name_Info newNameEntity = new Name_Info {Family_Name = Data};
                            Package.Bib_Info.Add_Named_Entity(newNameEntity);
                        }
                    }
                    else
                    {
                        Name_Info newNameEntity = new Name_Info {Family_Name = Data};
                        Package.Bib_Info.Add_Named_Entity(newNameEntity);
                    }
                    break;
                case Mapped_Fields.Creator_Given_Name:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info lastNamedEntity = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if (lastNamedEntity.Given_Name.Length == 0)
                            lastNamedEntity.Given_Name = Data;
                        else
                        {
                            Name_Info newNameEntity = new Name_Info {Given_Name = Data};
                            Package.Bib_Info.Add_Named_Entity(newNameEntity);
                        }
                    }
                    else
                    {
                        Name_Info newNameEntity = new Name_Info {Given_Name = Data};
                        Package.Bib_Info.Add_Named_Entity(newNameEntity);
                    }
                    break;
                case Mapped_Fields.Creator_Role:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info thisCreator = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if ((thisCreator.Roles.Count == 1) && ((thisCreator.Roles[0].Role == "creator") || (thisCreator.Roles[1].Role == "contributor")))
                            thisCreator.Roles.Clear();
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Add_Role(Data);
                    }
                    break;
                case Mapped_Fields.Cultural_Context:
                    VRACore_Info vraCoreInfo = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo == null)
                    {
                        vraCoreInfo = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo);
                    }
                    vraCoreInfo.Add_Cultural_Context(Data);
                    break;
                case Mapped_Fields.Donor:
                    Package.Bib_Info.Donor.Full_Name = Data;
                    break;
                case Mapped_Fields.Genre:
                    Package.Bib_Info.Add_Genre(Data);
                    break;
                case Mapped_Fields.Genre_Authority:
                    if (Package.Bib_Info.Genres_Count > 0)
                    {
                        Package.Bib_Info.Genres[Package.Bib_Info.Genres_Count - 1].Authority = Data;
                    }
                    break;
                case Mapped_Fields.Holding_Code:
                    Package.Bib_Info.Location.Holding_Code = Data;
                    break;
                case Mapped_Fields.Holding_Statement:
                    Package.Bib_Info.Location.Holding_Name = Data;
                    break;
                case Mapped_Fields.Identifier:
                    Package.Bib_Info.Add_Identifier(Data);
                    break;
                case Mapped_Fields.Identifier_Type:
                    if (Package.Bib_Info.Identifiers_Count > 0)
                    {
                        Package.Bib_Info.Identifiers[Package.Bib_Info.Identifiers_Count - 1].Type = Data;
                    }
                    break;
                case Mapped_Fields.Inscription:
                    VRACore_Info vraCoreInfo8 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo8 == null)
                    {
                        vraCoreInfo8 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo8);
                    }
                    vraCoreInfo8.Add_Inscription(Data);
                    break;
                case Mapped_Fields.Language:
                    Package.Bib_Info.Add_Language(Data);
                    break;
                case Mapped_Fields.Publisher:
                    Package.Bib_Info.Add_Publisher(Data);
                    break;
                case Mapped_Fields.Pub_Place:
                    Package.Bib_Info.Origin_Info.Add_Place(Data);
                    break;
                case Mapped_Fields.Related_URL_Label:
                    Package.Bib_Info.Location.Other_URL_Display_Label = Data;
                    break;
                case Mapped_Fields.Related_URL_Link:
                    Package.Bib_Info.Location.Other_URL = Data;
                    break;
                case Mapped_Fields.Related_URL_Note:
                    Package.Bib_Info.Location.Other_URL_Note = Data;
                    break;
                case Mapped_Fields.Source_Code:
                    Package.Bib_Info.Source.Code = Data;
                    break;
                case Mapped_Fields.Source_Statement:
                    Package.Bib_Info.Source.Statement = Data;
                    break;
                case Mapped_Fields.Subject_Keyword:
                    Package.Bib_Info.Add_Subject(Data, String.Empty);
                    break;
                case Mapped_Fields.Subject_Keyword_Authority:
                    if (Package.Bib_Info.Subjects_Count > 0)
                    {
                        Package.Bib_Info.Subjects[Package.Bib_Info.Subjects_Count - 1].Authority = Data;
                    }
                    break;
                case Mapped_Fields.BibID:
                    Package.Bib_Info.BibID = Data.ToUpper();
                    break;
                case Mapped_Fields.VID:
                    Package.Bib_Info.VID = Data.PadLeft(5, '0');
                    break;
                case Mapped_Fields.Date:
                    try
                    {
                        // first, try converting the string value to a date object
                        Package.Bib_Info.Origin_Info.Date_Issued = Convert.ToDateTime(Data).ToShortDateString();
                    }
                    catch
                    {
                        try
                        {
                            // second, try converting the string value to an integer
                            Package.Bib_Info.Origin_Info.Date_Issued = Convert.ToInt32(Data).ToString();
                        }
                        catch
                        {
                            Package.Bib_Info.Origin_Info.Date_Issued = Data;
                        }
                    }
                    break;
                case Mapped_Fields.Edition:
                    Package.Bib_Info.Origin_Info.Edition = Data;
                    break;
                case Mapped_Fields.Format:
                    Package.Bib_Info.Original_Description.Extent = Data;
                    break;
                case Mapped_Fields.Note:
                    Package.Bib_Info.Add_Note(Data);
                    break;
                case Mapped_Fields.Rights:
                    Package.Bib_Info.Access_Condition.Text = Data;
                    break;
                case Mapped_Fields.Series_Title:
                    Package.Bib_Info.SeriesTitle.Title = Data;
                    Package.Behaviors.GroupTitle = Data;
                    break;
                case Mapped_Fields.Type:
                    string upper_data = Data.ToUpper();
                    if (upper_data.IndexOf("NEWSPAPER") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Newspaper;
                        break;
                    }
                    if ((upper_data.IndexOf("MONOGRAPH") >= 0) || (upper_data.IndexOf("BOOK") >= 0))
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Book;
                        break;
                    }
                    if (upper_data.IndexOf("SERIAL") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Serial;
                        break;
                    }
                    if (upper_data.IndexOf("AERIAL") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Aerial;
                        if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                            Package.Bib_Info.Original_Description.Extent = "Aerial Photograph";
                        break;
                    }
                    if (upper_data.IndexOf("PHOTO") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        break;
                    }
                    if (upper_data.IndexOf("POSTCARD") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                            Package.Bib_Info.Original_Description.Extent = "Postcard";
                        break;
                    }
                    if (upper_data.IndexOf("MAP") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Map;
                        break;
                    }
                    if (upper_data.IndexOf("TEXT") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Book;
                        break;
                    }
                    if (upper_data.IndexOf("AUDIO") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Audio;
                        break;
                    }
                    if (upper_data.IndexOf("VIDEO") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Video;
                        break;
                    }
                    if ((upper_data.IndexOf("ARCHIVE") >= 0) || (upper_data.IndexOf("ARCHIVAL") >= 0))
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Archival;
                        break;
                    }
                    if (upper_data.IndexOf("ARTIFACT") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Artifact;
                        break;
                    }
                    if (upper_data.IndexOf("IMAGE") >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        break;
                    }

                    // if there was no match, set type to "UNDETERMINED"
                    Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.UNKNOWN;

                    if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                        Package.Bib_Info.Original_Description.Extent = "Undetermined";
                    break;
                case Mapped_Fields.Uniform_Title:
                    Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.uniform);
                    Package.Behaviors.GroupTitle = Data;
                    break;
                case Mapped_Fields.Title:
                    Package.Bib_Info.Main_Title.Title = Data;
                    break;
                case Mapped_Fields.Title_Language:
                    Package.Bib_Info.Main_Title.Language = Data;
                    break;
                case Mapped_Fields.Aleph:
                    Package.Bib_Info.Add_Identifier(Data, "ALEPH");
                    break;
                case Mapped_Fields.OCLC:
                    Package.Bib_Info.Add_Identifier(Data, "OCLC");
                    break;
                case Mapped_Fields.LCCN:
                    Package.Bib_Info.Add_Identifier(Data, "LCCN");
                    break;
                case Mapped_Fields.ISBN:
                    Package.Bib_Info.Add_Identifier(Data, "ISBN");
                    break;
                case Mapped_Fields.ISSN:
                    Package.Bib_Info.Add_Identifier(Data, "ISSN");
                    break;
                case Mapped_Fields.Sub_Title:
                    Package.Bib_Info.Main_Title.Subtitle = Data;
                    break;
                case Mapped_Fields.Volume:
                    Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    break;
                case Mapped_Fields.Issue:
                    if (Package.Bib_Info.Series_Part_Info.Enum1.Length == 0)
                    {
                        Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                    }
                    else
                    {
                        Package.Bib_Info.Series_Part_Info.Enum2 = Data;
                    }
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    break;
                case Mapped_Fields.Section:
                    if (Package.Bib_Info.Series_Part_Info.Enum2.Length == 0)
                    {
                        if (Package.Bib_Info.Series_Part_Info.Enum1.Length == 0)
                            Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                        else
                            Package.Bib_Info.Series_Part_Info.Enum2 = Data;
                    }
                    else
                    {
                        Package.Bib_Info.Series_Part_Info.Enum3 = Data;
                    }
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    // Do nothing for now
                    break;

                case Mapped_Fields.Year:
                    Package.Bib_Info.Series_Part_Info.Year = Data;

                    if (Data.Length == 1)
                        year = "0" + Data;
                    else
                        year = Data;
                    build_date_string(Package);

                    break;

                case Mapped_Fields.Month:
                    Package.Bib_Info.Series_Part_Info.Month = Data;
                    month = Data;
                    build_date_string(Package);

                    break;

                case Mapped_Fields.Day:
                    Package.Bib_Info.Series_Part_Info.Day = Data;
                    day = Data;
                    build_date_string(Package);

                    break;

                case Mapped_Fields.Coordinates:
                    GeoSpatial_Information geoInfo = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo == null)
                    {
                        geoInfo = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
                    }
                    string[] coordinates = Data.Split(", ;".ToCharArray());
                    try
                    {
                        if (coordinates.Length == 2)
                        {
                            geoInfo.Add_Point(Convert.ToDouble(coordinates[0]), Convert.ToDouble(coordinates[1]), String.Empty);
                        }
                        else
                        {
                            coordinates = Data.Split(",;".ToCharArray());
                            if (coordinates.Length == 2)
                            {
                                geoInfo.Add_Point(Convert.ToDouble(coordinates[0]), Convert.ToDouble(coordinates[1]), String.Empty);
                            }
                        }
                    }
                    catch
                    {
                    }
                    break;

                case Mapped_Fields.Latitude:
                    GeoSpatial_Information geoInfo2 = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo2 == null)
                    {
                        geoInfo2 = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo2);
                    }
                    try
                    {
                        if (geoInfo2.Point_Count == 0)
                            geoInfo2.Add_Point(Convert.ToDouble(Data), 0, String.Empty);
                        else
                            geoInfo2.Points[0].Latitude = Convert.ToDouble(Data);
                    }
                    catch
                    {
                    }
                    break;

                case Mapped_Fields.Longitude:
                    GeoSpatial_Information geoInfo3 = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo3 == null)
                    {
                        geoInfo3 = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo3);
                    }
                    try
                    {
                        if (geoInfo3.Point_Count == 0)
                            geoInfo3.Add_Point(0, Convert.ToDouble(Data.Replace("°", "")), String.Empty);
                        else
                            geoInfo3.Points[0].Longitude = Convert.ToDouble(Data.Replace("°", ""));
                    }
                    catch
                    {
                    }
                    break;

                case Mapped_Fields.Projection:
                    Guarantee_Cartographics(Package).Projection = Data;
                    break;
                case Mapped_Fields.Scale:
                    Guarantee_Cartographics(Package).Scale = Data;
                    break;
                    //case Mapped_Fields.Spatial_Coverage:
                    //    Package.Bib_Info.Hierarchical_Spatials[0].Area = Data;
                    //    break;
                case Mapped_Fields.Icon_Wordmarks:
                case Mapped_Fields.Wordmark:
                    //    Package.Processing_Parameters.Icons.Add(Data, String.Empty);
                    Package.Behaviors.Add_Wordmark(Data);
                    break;
                case Mapped_Fields.Webskin:
                    Package.Behaviors.Add_Web_Skin(Data);
                    break;
                case Mapped_Fields.Temporal_Coverage:
                    Package.Bib_Info.Add_Temporal_Subject(-1, -1, Data);
                    break;
                case Mapped_Fields.Affiliation_University:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].University = Data;
                    break;
                case Mapped_Fields.Affiliation_Campus:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Campus = Data;
                    break;
                case Mapped_Fields.Affiliation_College:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].College = Data;
                    break;
                case Mapped_Fields.Affiliation_Unit:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Unit = Data;
                    break;
                case Mapped_Fields.Affiliation_Department:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Department = Data;
                    break;
                case Mapped_Fields.Affiliation_Institute:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Institute = Data;
                    break;
                case Mapped_Fields.Affiliation_Center:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Center = Data;
                    break;
                case Mapped_Fields.Affiliation_Section:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Section = Data;
                    break;
                case Mapped_Fields.Affiliation_Subsection:
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].SubSection = Data;
                    break;
                case Mapped_Fields.Geography_Continent:
                    Guarantee_Hierarchical_Spatial(Package).Continent = Data;
                    break;
                case Mapped_Fields.Geography_Country:
                    Guarantee_Hierarchical_Spatial(Package).Country = Data;
                    break;
                case Mapped_Fields.Geography_Province:
                    Guarantee_Hierarchical_Spatial(Package).Province = Data;
                    break;
                case Mapped_Fields.Geography_Region:
                    Guarantee_Hierarchical_Spatial(Package).Region = Data;
                    break;
                case Mapped_Fields.Geography_State:
                    Guarantee_Hierarchical_Spatial(Package).State = Data;
                    break;
                case Mapped_Fields.Geography_Territory:
                    Guarantee_Hierarchical_Spatial(Package).Territory = Data;
                    break;
                case Mapped_Fields.Geography_County:
                    Guarantee_Hierarchical_Spatial(Package).County = Data;
                    break;
                case Mapped_Fields.Geography_City:
                    Guarantee_Hierarchical_Spatial(Package).City = Data;
                    break;
                case Mapped_Fields.Geography_Island:
                    Guarantee_Hierarchical_Spatial(Package).Island = Data;
                    break;
                case Mapped_Fields.Geography_Area:
                    Guarantee_Hierarchical_Spatial(Package).Area = Data;
                    break;
                case Mapped_Fields.Copyright_Date:
                    Package.Bib_Info.Origin_Info.Date_Copyrighted = Data;
                    break;
                case Mapped_Fields.EAD_Name:
                    Package.Bib_Info.Location.EAD_Name = Data;
                    break;
                case Mapped_Fields.EAD_URL:
                    Package.Bib_Info.Location.EAD_URL = Data;
                    break;
                case Mapped_Fields.Internal_Comments:
                    Package.Tracking.Internal_Comments = Data;
                    break;
                case Mapped_Fields.Container_Box:
                    Package.Bib_Info.Add_Container("Box", Data, 1);
                    break;
                case Mapped_Fields.Container_Divider:
                    Package.Bib_Info.Add_Container("Divider", Data, 2);
                    break;
                case Mapped_Fields.Container_Folder:
                    Package.Bib_Info.Add_Container("Folder", Data, 3);
                    break;
                case Mapped_Fields.Viewer:
                    switch (Data.ToUpper().Replace("_"," ").Replace(" ",""))
                    {
                        case "JPEG":
                        case "JPG":
                            Package.Behaviors.Add_View(View_Enum.JPEG);
                            break;

                        case "JPEG2000":
                        case "JP2":
                            Package.Behaviors.Add_View(View_Enum.JPEG2000);
                            break;

                        case "PAGETURNER":
                            Package.Behaviors.Add_View(View_Enum.PAGE_TURNER);
                            break;

                        case "RELATEDIMAGES":
                        case "THUMBNAILS":
                            Package.Behaviors.Add_View(View_Enum.RELATED_IMAGES);
                            break;
                    }
                    break;
                case Mapped_Fields.Visibility:
                    switch (Data.ToUpper())
                    {
                        case "DARK":
                            Package.Behaviors.Dark_Flag = true;
                            Package.Behaviors.IP_Restriction_Membership = -1;
                            break;

                        case "PRIVATE":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = -1;
                            break;

                        case "PUBLIC":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = 0;
                            break;

                        case "RESTRICTED":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = 1;
                            break;
                    }
                    break;

                case Mapped_Fields.Tickler:
                    Package.Behaviors.Add_Tickler(Data);
                    break;

                case Mapped_Fields.Tracking_Box:
                    Package.Tracking.Tracking_Box = Data;
                    break;

                case Mapped_Fields.Born_Digital_Flag:
                    if (Data.ToUpper().Trim() == "TRUE")
                        Package.Tracking.Born_Digital = true;
                    break;

                case Mapped_Fields.Material_Received_Date:
                    DateTime materialReceivedDate;
                    if (DateTime.TryParse(Data, out materialReceivedDate))
                        Package.Tracking.Material_Received_Date = materialReceivedDate;
                    break;

                case Mapped_Fields.Materials:
                    VRACore_Info vraCoreInfo2 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo2 == null)
                    {
                        vraCoreInfo2 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo2);
                    }
                    vraCoreInfo2.Add_Material(Data, "medium");
                    break;

                case Mapped_Fields.Measurements:
                    VRACore_Info vraCoreInfo3 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo3 == null)
                    {
                        vraCoreInfo3 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo3);
                    }
                    vraCoreInfo3.Add_Measurement(Data, String.Empty);
                    break;

                case Mapped_Fields.State_Edition:
                    VRACore_Info vraCoreInfo4 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo4 == null)
                    {
                        vraCoreInfo4 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo4);
                    }
                    vraCoreInfo4.Add_State_Edition(Data);
                    break;

                case Mapped_Fields.Style_Period:
                    VRACore_Info vraCoreInfo5 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo5 == null)
                    {
                        vraCoreInfo5 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo5);
                    }
                    vraCoreInfo5.Add_Style_Period(Data);
                    break;

                case Mapped_Fields.Technique:
                    VRACore_Info vraCoreInfo6 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo6 == null)
                    {
                        vraCoreInfo6 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo6);
                    }
                    vraCoreInfo6.Add_Technique(Data);
                    break;
            }
        }
        private static Name_Info read_name_object(XmlReader r)
        {
            Name_Info returnValue = new Name_Info();

            if (r.MoveToAttribute("type"))
            {
                if (r.Value == "personal")
                    returnValue.Name_Type = Name_Info_Type_Enum.personal;
                if (r.Value == "corporate")
                    returnValue.Name_Type = Name_Info_Type_Enum.corporate;
                if (r.Value == "conference")
                    returnValue.Name_Type = Name_Info_Type_Enum.conference;
            }

            if (r.MoveToAttribute("ID"))
                returnValue.ID = r.Value;

            while (r.Read())
            {
                if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:name") || (r.Name == "name")))
                    return returnValue;

                if (r.NodeType == XmlNodeType.Element)
                {
                    switch (r.Name)
                    {
                        case "mods:displayForm":
                        case "displayForm":
                            r.Read();
                            if (r.NodeType == XmlNodeType.Text)
                            {
                                returnValue.Display_Form = r.Value;
                            }
                            break;

                        case "mods:affiliation":
                        case "affiliation":
                            r.Read();
                            if (r.NodeType == XmlNodeType.Text)
                            {
                                returnValue.Affiliation = r.Value;
                            }
                            break;

                        case "mods:description":
                        case "description":
                            r.Read();
                            if (r.NodeType == XmlNodeType.Text)
                            {
                                returnValue.Description = r.Value;
                            }
                            break;

                        case "mods:namePart":
                        case "namePart":
                            string type = String.Empty;
                            if (r.MoveToAttribute("type"))
                            {
                                type = r.Value;
                            }
                            r.Read();
                            if (r.NodeType == XmlNodeType.Text)
                            {
                                switch (type)
                                {
                                    case "given":
                                        returnValue.Given_Name = r.Value;
                                        break;

                                    case "family":
                                        returnValue.Family_Name = r.Value;
                                        break;

                                    case "termsOfAddress":
                                        returnValue.Terms_Of_Address = r.Value;
                                        break;

                                    case "date":
                                        returnValue.Dates = r.Value;
                                        break;

                                    default:
                                        returnValue.Full_Name = r.Value;
                                        break;
                                }
                            }
                            break;

                        case "mods:roleTerm":
                        case "roleTerm":
                            string role_type = String.Empty;
                            string role_authority = String.Empty;
                            if (r.MoveToAttribute("type"))
                                role_type = r.Value;
                            if (r.MoveToAttribute("authority"))
                                role_authority = r.Value;
                            r.Read();
                            if (r.NodeType == XmlNodeType.Text)
                            {
                                switch (role_type)
                                {
                                    case "code":
                                        returnValue.Add_Role(r.Value, role_authority, Name_Info_Role_Type_Enum.code);
                                        break;

                                    case "text":
                                        returnValue.Add_Role(r.Value, role_authority, Name_Info_Role_Type_Enum.text);
                                        break;

                                    default:
                                        if (r.Value == "Main Entity")
                                            returnValue.Main_Entity = true;
                                        else
                                            returnValue.Add_Role(r.Value, role_authority, Name_Info_Role_Type_Enum.UNSPECIFIED);
                                        break;
                                }
                            }
                            break;
                    }
                }
            }

            return returnValue;
        }
        /// <summary> Add a new named entity (i.e., creator, contributor) associated with this digital resource  </summary>
        /// <param name="New_Name"> Named entity object </param>
        /// <returns>Newly built name subject</returns>
        public void Add_Named_Entity(Name_Info New_Name)
        {
            if (names == null)
                names = new List<Name_Info>();

            names.Add(New_Name);
        }
        /// <summary> Add a new named entity (i.e., creator, contributor) associated with this digital resource  </summary>
        /// <param name="Name"> Name of the new named entity to associate</param>
        /// <returns>Newly built and added name entity</returns>
        public Name_Info Add_Named_Entity(string Name)
        {
            if (names == null)
                names = new List<Name_Info>();

            Name_Info newName = new Name_Info(Name, String.Empty);
            names.Add(newName);
            return newName;
        }
 /// <summary> Removes a named entity from the collection of names associated with this digital resource </summary>
 /// <remarks> Named entity to remove</remarks>
 public void Remove_Name(Name_Info Name)
 {
     if ((names != null) && (names.Contains(Name)))
         names.Remove(Name);
 }
        /// <summary> Add a new named entity (i.e., creator, contributor) associated with this digital resource  </summary>
        /// <param name="Name"> Name of the new named entity to associate</param>
        /// <param name="Text_Role"> Role of this named entity </param>
        /// <param name="MARC_Role"> ROle of thie entity encoded in MARC </param>
        /// <returns>Newly built and added name entity</returns>
        public Name_Info Add_Named_Entity(string Name, string Text_Role, string MARC_Role)
        {
            if (names == null)
                names = new List<Name_Info>();

            Name_Info newName = new Name_Info(Name, Text_Role);
            newName.Add_Role(MARC_Role, "marcrelator", Name_Info_Role_Type_Enum.Code);
            names.Add(newName);
            return newName;
        }
        /// <summary> Add a new named entity (i.e., creator, contributor) associated with this digital resource  </summary>
        /// <param name="Name"> Name of the new named entity to associate</param>
        /// <param name="Text_Role"> Role of this named entity </param>
        /// <returns>Newly built and added name entity</returns>
        public Name_Info Add_Named_Entity(string Name, string Text_Role)
        {
            if (names == null)
                names = new List<Name_Info>();

            Name_Info newName = new Name_Info(Name, Text_Role);
            names.Add(newName);
            return newName;
        }
        /// <summary> Saves the data rendered by this element to the provided bibliographic object during postback </summary>
        /// <param name="Bib"> Object into which to save the user's data, entered into the html rendered by this element </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            string type = String.Empty;
            foreach (string thisKey in getKeys)
            {
                if (thisKey == "irtype")
                {
                    type = HttpContext.Current.Request.Form[thisKey];
                    if ((type != "Select Material Type") && ( type != "Other" ))
                    {
                        Bib.Bib_Info.SobekCM_Type_String = type;

                        if (Bib.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.UNKNOWN)
                        {
                            Bib.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Archival;
                            Bib.Bib_Info.Original_Description.Extent = type;
                        }
                    }
                }

                if (thisKey == "irtype_otherinput")
                {
                    string other_type = HttpContext.Current.Request.Form[thisKey];
                    if (other_type.Trim().Length > 0)
                    {
                        Bib.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Archival;
                        Bib.Bib_Info.Original_Description.Extent = HttpContext.Current.Request.Form[thisKey];
                    }
                }

                if (thisKey.IndexOf("largerbody") == 0)
                {
                    string largerbody = HttpContext.Current.Request.Form[thisKey];
                    if (largerbody.Trim().Length > 0)
                    {
                        switch (type)
                        {
                            case "Book Chapter":
                                Bib.Bib_Info.SeriesTitle.Clear();
                                Bib.Bib_Info.SeriesTitle.Title = largerbody;
                                break;

                            case "Conference Papers":
                            case "Conference Proceedings":
                                bool found_conference_name = false;
                                if (Bib.Bib_Info.Names_Count > 0)
                                {
                                    foreach (Name_Info thisName in Bib.Bib_Info.Names)
                                    {
                                        if (thisName.Name_Type == Name_Info_Type_Enum.Conference)
                                        {
                                            thisName.Clear();
                                            thisName.Name_Type = Name_Info_Type_Enum.Conference;
                                            thisName.Full_Name = largerbody;
                                            found_conference_name = true;
                                            break;
                                        }
                                    }
                                }
                                if (!found_conference_name)
                                {
                                    Name_Info conferenceName = new Name_Info
                                                                   {
                                                                       Name_Type = Name_Info_Type_Enum.Conference,
                                                                       Full_Name = largerbody
                                                                   };
                                    Bib.Bib_Info.Add_Named_Entity(conferenceName);
                                }
                                break;

                            case "Course Material":
                                Bib.Bib_Info.SeriesTitle.Clear();
                                Bib.Bib_Info.SeriesTitle.Title = largerbody;
                                break;

                            case "Journal Article":
                                Bib.Bib_Info.SeriesTitle.Clear();
                                Bib.Bib_Info.SeriesTitle.Title = largerbody;
                                break;

                            case "Technical Reports":
                                Bib.Bib_Info.SeriesTitle.Clear();
                                Bib.Bib_Info.SeriesTitle.Title = largerbody;
                                break;

                            default:
                                Bib.Bib_Info.SeriesTitle.Clear();
                                Bib.Bib_Info.SeriesTitle.Title = largerbody;
                                break;
                        }
                    }
                }
            }
        }
        /// <summary> Adds a bit of data to a bibliographic package using the mapping </summary>
        /// <param name="Package">Bibliographic package to receive the data</param>
        /// <param name="Data">Text of the data</param>
        /// <param name="Field">Mapped field</param>
        /// <returns> TRUE if the field was mapped, FALSE if there was data and no mapping was found </returns>
        public bool Add_Data(SobekCM_Item Package, string Data, string Field)
        {
            // If no field listed, just skip (but not a mapping error, so return TRUE)
            if (String.IsNullOrEmpty(Field))
                return true;

            // If no data listed, just skip (but not a mapping error, so return TRUE)
            if (String.IsNullOrWhiteSpace(Data))
                return true;

            // Trim the data
            Data = Data.Trim();

            // Normalize the field name
            string correctName = Field.ToUpper().Replace("#", "").Replace(" ", "").Replace(".", "").Replace(":", "").Replace("\\", "").Replace("/", "").Replace(")", "").Replace("(", "").Trim();
            if (correctName.Length == 0)
            {
                correctName = "None";
            }
            else
            {
                // Find the first number
                int charIndex = 0;
                while ((charIndex < correctName.Length) && (!Char.IsNumber(correctName[charIndex])))
                {
                    charIndex++;
                }

                // If the index stopped before the end (that is, it found a number),
                // trim the number of the column name
                if ((charIndex < correctName.Length) && (charIndex > 0))
                {
                    correctName = correctName.Substring(0, charIndex);
                }

                // If it was all numbers, just assign NONE
                if (charIndex == 0)
                {
                    correctName = "None";
                }
            }

            // Everything depends on the field which is mapped
            switch (correctName)
            {
                case "NONE":
                    // Do nothing, since no mapping exists
                    return true;

                case "ABSTRACT":
                case "SUMMARY":
                    Package.Bib_Info.Add_Abstract(Data, "en");
                    return true;

                case "ACCESSION":
                case "ACCESSIONNUMBER":
                    Package.Bib_Info.Add_Identifier(Data, "Accession Number");
                    return true;

                case "ALTERNATETITLE":
                case "ALTTITLE":
                case "TITLEVARIANT":
                    Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.Alternative);
                    return true;

                case "ALTERNATETITLELANGUAGE":
                case "ALTTITLELANGUAGE":
                    List<Title_Info> otherTitles = Package.Bib_Info.Other_Titles.Where(ThisTitle => ThisTitle.Title_Type == Title_Type_Enum.Alternative).ToList();
                    if (otherTitles.Count > 0)
                    {
                        otherTitles[otherTitles.Count - 1].Language = Data;
                    }
                    return true;

                case "TITLETRANSLATION":
                case "TRANSLATEDTITLE":
                    Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.Translated);
                    return true;

                case "ATTRIBUTION":
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.Funding);
                    return true;

                case "COLLECTION":
                case "COLLECTIONCODE":
                case "AGGREGATION":
                case "AGGREGATIONCODE":
                case "SUBCOLLECTION":
                case "SUBCOLLECTIONS":
                    Package.Behaviors.Add_Aggregation(Data.ToUpper());
                    return true;

                case "CLASSIFICATION":
                    Package.Bib_Info.Add_Classification(Data);
                    return true;

                case "CLASSIFICATIONTYPE":
                case "CLASSIFICATIONAUTHORITY":
                    if (Package.Bib_Info.Classifications_Count > 0)
                    {
                        Package.Bib_Info.Classifications[Package.Bib_Info.Classifications_Count - 1].Authority = Data;
                    }
                    return true;

                case "CONTRIBUTOR":
                case "CONTRIBUTORS":
                    Package.Bib_Info.Add_Named_Entity(new Name_Info(Data, "contributor"));
                    return true;

                case "CREATOR":
                case "CREATORS":
                case "AUTHOR":
                    // Ensure it doesn't already exist
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        foreach (Name_Info thisName in Package.Bib_Info.Names)
                        {
                            if (String.Compare(thisName.Full_Name, Data, StringComparison.OrdinalIgnoreCase) == 0)
                                return true;
                        }
                    }
                    Package.Bib_Info.Add_Named_Entity(new Name_Info(Data, "creator"));
                    return true;

                case "CREATORPERSONALNAME":

                    // Ensure it doesn't already exist
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        foreach (Name_Info thisName in Package.Bib_Info.Names)
                        {
                            if (String.Compare(thisName.Full_Name, Data, StringComparison.OrdinalIgnoreCase) == 0)
                                return true;
                        }
                    }

                    Name_Info personalCreator = new Name_Info(Data, "creator");
                    personalCreator.Name_Type = Name_Info_Type_Enum.Personal;
                    Package.Bib_Info.Add_Named_Entity(personalCreator);
                    return true;

                case "CREATORCORPORATENAME":
                    Name_Info corporateCreator = new Name_Info(Data, "creator");
                    corporateCreator.Name_Type = Name_Info_Type_Enum.Corporate;
                    Package.Bib_Info.Add_Named_Entity(corporateCreator);
                    return true;

                case "CREATORLANGUAGE":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Description = Data;
                    }
                    return true;

                case "CREATORAFFILIATION":
                case "AUTHORAFFILIATION":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Affiliation = Data;
                    }
                    return true;

                case "CREATORDATES":
                case "AUTHORDATES":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Dates = Data;
                    }
                    return true;

                case "CREATORFAMILYNAME":
                case "AUTHORFAMILYNAME":
                case "FAMILYNAME":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info lastNamedEntity = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if (lastNamedEntity.Family_Name.Length == 0)
                            lastNamedEntity.Family_Name = Data;
                        else
                        {
                            Name_Info newNameEntity = new Name_Info { Family_Name = Data };
                            Package.Bib_Info.Add_Named_Entity(newNameEntity);
                        }
                    }
                    else
                    {
                        Name_Info newNameEntity = new Name_Info { Family_Name = Data };
                        Package.Bib_Info.Add_Named_Entity(newNameEntity);
                    }
                    return true;

                case "CREATORGIVENNAME":
                case "AUTHORGIVENNAME":
                case "GIVENNAME":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info lastNamedEntity = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if (lastNamedEntity.Given_Name.Length == 0)
                            lastNamedEntity.Given_Name = Data;
                        else
                        {
                            Name_Info newNameEntity = new Name_Info { Given_Name = Data };
                            Package.Bib_Info.Add_Named_Entity(newNameEntity);
                        }
                    }
                    else
                    {
                        Name_Info newNameEntity = new Name_Info { Given_Name = Data };
                        Package.Bib_Info.Add_Named_Entity(newNameEntity);
                    }
                    return true;

                case "CREATORROLE":
                case "AUTHORROLE":
                case "CREATORROLES":
                case "AUTHORROLES":
                case "CREATORATTRIBUTION":
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info thisCreator = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if ((thisCreator.Roles.Count == 1) && ((thisCreator.Roles[0].Role == "creator") || (thisCreator.Roles[1].Role == "contributor")))
                            thisCreator.Roles.Clear();
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Add_Role(Data);
                    }
                    return true;

                case "CULTURALCONTEXT":
                case "CULTURE":
                    VRACore_Info vraCoreInfo = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo == null)
                    {
                        vraCoreInfo = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo);
                    }
                    vraCoreInfo.Add_Cultural_Context(Data);
                    return true;

                case "DONOR":
                    Package.Bib_Info.Donor.Full_Name = Data;
                    return true;

                case "GENRE":
                    Package.Bib_Info.Add_Genre(Data);
                    return true;

                case "GENREAUTHORITY":
                    if (Package.Bib_Info.Genres_Count > 0)
                    {
                        Package.Bib_Info.Genres[Package.Bib_Info.Genres_Count - 1].Authority = Data;
                    }
                    return true;

                case "HOLDINGLOCATIONCODE":
                case "HOLDINGCODE":
                    Package.Bib_Info.Location.Holding_Code = Data;
                    return true;

                case "HOLDINGLOCATIONSTATEMENT":
                case "HOLDINGSTATEMENT":
                case "CONTRIBUTINGINSTITUTION":
                case "LOCATIONCURRENT":
                case "LOCATIONCURRENTSITE":
                case "LOCATIONCURRENTREPOSITORY":
                    Package.Bib_Info.Location.Holding_Name = Data;
                    return true;

                case "LOCATIONFORMERSITE":
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.OriginalLocation);
                    return true;

                case "IDENTIFIER":
                case "IDNUMBERFORMERREPOSITORY":
                case "IDNUMBERCURRENTREPOSITORY":
                case "IDNUMBERCURRENTRESPOSITORY":
                    Package.Bib_Info.Add_Identifier(Data);
                    return true;

                case "IDENTIFIERTYPE":
                    if (Package.Bib_Info.Identifiers_Count > 0)
                    {
                        Package.Bib_Info.Identifiers[Package.Bib_Info.Identifiers_Count - 1].Type = Data;
                    }
                    return true;

                case "INSCRIPTION":
                    VRACore_Info vraCoreInfo8 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo8 == null)
                    {
                        vraCoreInfo8 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo8);
                    }
                    vraCoreInfo8.Add_Inscription(Data);
                    return true;

                case "LANGUAGE":
                    Package.Bib_Info.Add_Language(Data);
                    return true;

                case "PUBLISHER":
                case "PUBLISHERS":
                    Package.Bib_Info.Add_Publisher(Data);
                    return true;

                case "PLACEOFPUBLICATION":
                case "PUBLICATIONPLACE":
                case "PUBPLACE":
                case "PUBLICATIONLOCATION":
                case "PLACE":
                    Package.Bib_Info.Origin_Info.Add_Place(Data);
                    return true;

                case "RELATEDURLLABEL":
                    Package.Bib_Info.Location.Other_URL_Display_Label = Data;
                    return true;

                case "RELATEDURL":
                case "RELATEDURLLINK":
                    Package.Bib_Info.Location.Other_URL = Data;
                    return true;

                case "RELATEDURLNOTE":
                case "RELATEDURLNOTES":
                    Package.Bib_Info.Location.Other_URL_Note = Data;
                    return true;

                case "SOURCEINSTITUTIONCODE":
                case "SOURCECODE":
                    Package.Bib_Info.Source.Code = Data;
                    return true;

                case "SOURCEINSTITUTIONSTATEMENT":
                case "SOURCESTATEMENT":
                case "SOURCE":
                    Package.Bib_Info.Source.Statement = Data;
                    return true;

                case "SUBJECTKEYWORD":
                case "SUBJECTKEYWORDS":
                case "SUBJECT":
                case "SUBJECTS":
                case "KEYWORDS":
                    Package.Bib_Info.Add_Subject(Data, String.Empty);
                    return true;

                case "SUBJECTKEYWORDAUTHORITY":
                case "SUBJECTAUTHORITY":
                    if (Package.Bib_Info.Subjects_Count > 0)
                    {
                        Package.Bib_Info.Subjects[Package.Bib_Info.Subjects_Count - 1].Authority = Data;
                    }
                    return true;

                case "BIBID":
                case "BIB":
                case "BIBLIOGRAHPICID":
                case "BIBLIOGRAPHICIDENTIFIER":
                    Package.Bib_Info.BibID = Data.ToUpper();
                    return true;

                case "VID":
                    Package.Bib_Info.VID = Data.PadLeft(5, '0');
                    return true;

                case "DATE":
                case "DATECREATION":
                    try
                    {
                        // first, try converting the string value to a date object
                        Package.Bib_Info.Origin_Info.Date_Issued = Convert.ToDateTime(Data).ToShortDateString();
                    }
                    catch
                    {
                        try
                        {
                            // second, try converting the string value to an integer
                            Package.Bib_Info.Origin_Info.Date_Issued = Convert.ToInt32(Data).ToString();
                        }
                        catch
                        {
                            Package.Bib_Info.Origin_Info.Date_Issued = Data;
                        }
                    }
                    return true;

                case "DATEBEGINNING":
                    Package.Bib_Info.Origin_Info.MARC_DateIssued_Start = Data;
                    return true;

                case "DATECOMPLETION":
                    Package.Bib_Info.Origin_Info.MARC_DateIssued_End = Data;
                    return true;

                case "EDITION":
                    Package.Bib_Info.Origin_Info.Edition = Data;
                    return true;

                case "FORMAT":
                case "PHYSICALDESCRIPTION":
                case "EXTENT":
                    Package.Bib_Info.Original_Description.Extent = Data;
                    return true;

                case "NOTE":
                case "NOTES":
                case "DESCRIPTION":
                    Package.Bib_Info.Add_Note(Data);
                    return true;

                case "PROVENANCE":
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.Acquisition);
                    return true;

                case "USAGESTATEMENT":
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.CitationReference);
                    return true;

                case "CONTACT":
                case "CONTACTNOTES":
                case "CONTACTINFORMATION":
                    Package.Bib_Info.Add_Note(Data, Note_Type_Enum.NONE, "Contact");
                    return true;

                case "RIGHTS":
                    Package.Bib_Info.Access_Condition.Text = Data;
                    return true;

                case "BIBSERIESTITLE":
                case "SERIESTITLE":
                case "TITLESERIES":
                    Package.Bib_Info.SeriesTitle.Title = Data;
                    Package.Behaviors.GroupTitle = Data;
                    return true;

                case "MATERIALTYPE":
                case "TYPE":
                case "RECORDTYPE":
                    string upper_data = Data.ToUpper();
                    if (upper_data.IndexOf("NEWSPAPER", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Newspaper;
                        return true;
                    }
                    if ((upper_data.IndexOf("MONOGRAPH", StringComparison.Ordinal) >= 0) || (upper_data.IndexOf("BOOK", StringComparison.Ordinal) >= 0))
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Book;
                        return true;
                    }
                    if (upper_data.IndexOf("SERIAL", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Serial;
                        return true;
                    }
                    if (upper_data.IndexOf("AERIAL", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Aerial;
                        if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                            Package.Bib_Info.Original_Description.Extent = "Aerial Photograph";
                        return true;
                    }
                    if (upper_data.IndexOf("PHOTO", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        return true;
                    }
                    if (upper_data.IndexOf("POSTCARD", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                            Package.Bib_Info.Original_Description.Extent = "Postcard";
                        return true;
                    }
                    if (upper_data.IndexOf("MAP", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Map;
                        return true;
                    }
                    if (upper_data.IndexOf("TEXT", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Book;
                        return true;
                    }
                    if (upper_data.IndexOf("AUDIO", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Audio;
                        return true;
                    }
                    if (upper_data.IndexOf("VIDEO", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Video;
                        return true;
                    }
                    if ((upper_data.IndexOf("ARCHIVE", StringComparison.Ordinal) >= 0) || (upper_data.IndexOf("ARCHIVAL", StringComparison.Ordinal) >= 0))
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Archival;
                        return true;
                    }
                    if (upper_data.IndexOf("ARTIFACT", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Artifact;
                        return true;
                    }
                    if (upper_data.IndexOf("IMAGE", StringComparison.Ordinal) >= 0)
                    {
                        Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Photograph;
                        return true;
                    }

                    // if there was no match, set type to "UNDETERMINED"
                    Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.UNKNOWN;

                    if (Package.Bib_Info.Original_Description.Extent.Length == 0)
                        Package.Bib_Info.Original_Description.Extent = "Undetermined";
                    return true;

                case "BIBUNIFORMTITLE":
                case "UNIFORMTITLE":
                    Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.Uniform);
                    Package.Behaviors.GroupTitle = Data;
                    return true;

                case "VOLUMETITLE":
                case "TITLE":
                    if (String.IsNullOrEmpty(Package.Bib_Info.Main_Title.Title))
                        Package.Bib_Info.Main_Title.Title = Data;
                    else
                        Package.Bib_Info.Add_Other_Title(Data, Title_Type_Enum.Alternative);
                    return true;

                case "TITLELANGUAGE":
                    Package.Bib_Info.Main_Title.Language = Data;
                    return true;

                case "ALEPH":
                    Package.Bib_Info.Add_Identifier(Data, "ALEPH");
                    return true;

                case "OCLC":
                    Package.Bib_Info.Add_Identifier(Data, "OCLC");
                    return true;

                case "LCCN":
                    Package.Bib_Info.Add_Identifier(Data, "LCCN");
                    return true;

                case "ISBN":
                    Package.Bib_Info.Add_Identifier(Data, "ISBN");
                    return true;

                case "ISSN":
                    Package.Bib_Info.Add_Identifier(Data, "ISSN");
                    return true;

                case "SUBTITLE":
                    Package.Bib_Info.Main_Title.Subtitle = Data;
                    return true;

                case "VOLUME":
                    Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    return true;

                case "ISSUE":
                    if (Package.Bib_Info.Series_Part_Info.Enum1.Length == 0)
                    {
                        Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                    }
                    else
                    {
                        Package.Bib_Info.Series_Part_Info.Enum2 = Data;
                    }
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    return true;

                case "SECTION":
                    if (Package.Bib_Info.Series_Part_Info.Enum2.Length == 0)
                    {
                        if (Package.Bib_Info.Series_Part_Info.Enum1.Length == 0)
                            Package.Bib_Info.Series_Part_Info.Enum1 = Data;
                        else
                            Package.Bib_Info.Series_Part_Info.Enum2 = Data;
                    }
                    else
                    {
                        Package.Bib_Info.Series_Part_Info.Enum3 = Data;
                    }
                    Package.Behaviors.Serial_Info.Add_Hierarchy(Package.Behaviors.Serial_Info.Count + 1, 1, Data);
                    // Do nothing for now
                    return true;

                case "YEAR":
                    Package.Bib_Info.Series_Part_Info.Year = Data;

                    if (Data.Length == 1)
                        year = "0" + Data;
                    else
                        year = Data;
                    build_date_string(Package);

                    return true;

                case "MONTH":
                    Package.Bib_Info.Series_Part_Info.Month = Data;
                    month = Data;
                    build_date_string(Package);

                    return true;

                case "DAY":
                    Package.Bib_Info.Series_Part_Info.Day = Data;
                    day = Data;
                    build_date_string(Package);

                    return true;

                case "COORDINATES":
                    GeoSpatial_Information geoInfo = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo == null)
                    {
                        geoInfo = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
                    }
                    string[] coordinates = Data.Split(", ;".ToCharArray());
                    try
                    {
                        if (coordinates.Length == 2)
                        {
                            geoInfo.Add_Point(Convert.ToDouble(coordinates[0]), Convert.ToDouble(coordinates[1]), String.Empty);
                        }
                        else
                        {
                            coordinates = Data.Split(",;".ToCharArray());
                            if (coordinates.Length == 2)
                            {
                                geoInfo.Add_Point(Convert.ToDouble(coordinates[0]), Convert.ToDouble(coordinates[1]), String.Empty);
                            }
                        }
                    }
                    catch
                    {
                    }
                    return true;

                case "LATITUDE":
                case "COORDINATESLATITUDE":
                    GeoSpatial_Information geoInfo2 = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo2 == null)
                    {
                        geoInfo2 = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo2);
                    }
                    try
                    {
                        if (geoInfo2.Point_Count == 0)
                            geoInfo2.Add_Point(Convert.ToDouble(Data), 0, String.Empty);
                        else
                            geoInfo2.Points[0].Latitude = Convert.ToDouble(Data);
                    }
                    catch
                    {
                    }
                    return true;

                case "LONGITUDE":
                case "COORDINATESLONGITUDE":
                    GeoSpatial_Information geoInfo3 = Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                    if (geoInfo3 == null)
                    {
                        geoInfo3 = new GeoSpatial_Information();
                        Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo3);
                    }
                    try
                    {
                        if (geoInfo3.Point_Count == 0)
                            geoInfo3.Add_Point(0, Convert.ToDouble(Data.Replace("°", "")), String.Empty);
                        else
                            geoInfo3.Points[0].Longitude = Convert.ToDouble(Data.Replace("°", ""));
                    }
                    catch
                    {
                    }
                    return true;

                case "PROJECTION":
                case "MAPPROJECTION":
                    Guarantee_Cartographics(Package).Projection = Data;
                    return true;

                case "SCALE":
                case "MAPSCALE":
                    Guarantee_Cartographics(Package).Scale = Data;
                    return true;

                //case Mapped_Fields.Spatial_Coverage:
                //    Package.Bib_Info.Hierarchical_Spatials[0].Area = Data;
                //    return true;

                case "ICON/WORDMARK":
                case "ICON/WORDMARKS":
                case "ICON":
                case "ICONS":
                case "WORDMARK":
                case "WORDMARKS":
                    Package.Behaviors.Add_Wordmark(Data);
                    return true;

                case "WEBSKINS":
                case "WEBSKIN":
                case "SKINS":
                case "SKIN":
                    Package.Behaviors.Add_Web_Skin(Data);
                    return true;

                case "TEMPORALCOVERAGE":
                case "TEMPORAL":
                case "TIMEPERIOD":
                    Package.Bib_Info.Add_Temporal_Subject(-1, -1, Data);
                    return true;

                case "COVERAGE":
                    // Was this a number.. likely, a year?
                    int possible_year;
                    if (( Data.Length >= 4 ) && ( Int32.TryParse(Data.Substring(0,4), out possible_year)))
                        Package.Bib_Info.Add_Temporal_Subject(-1, -1, Data);
                    else
                        Package.Bib_Info.Add_Spatial_Subject(Data);
                    return true;

                case "AFFILIATIONUNIVERSITY":
                case "UNIVERSITY":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].University = Data;
                    return true;

                case "AFFILIATIONCAMPUS":
                case "CAMPUS":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Campus = Data;
                    return true;

                case "AFFILIATIONCOLLEGE":
                case "COLLEGE":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].College = Data;
                    return true;

                case "AFFILIATIONUNIT":
                case "UNIT":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Unit = Data;
                    return true;

                case "AFFILIATIONDEPARTMENT":
                case "DEPARTMENT":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Department = Data;
                    return true;

                case "AFFILIATIONINSTITUTE":
                case "INSTITUTE":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Institute = Data;
                    return true;

                case "AFFILIATIONCENTER":
                case "CENTER":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Center = Data;
                    return true;

                case "AFFILIATIONSECTION":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].Section = Data;
                    return true;

                case "AFFILIATIONSUBSECTION":
                    Guarantee_Affiliation_Collection(Package);
                    Package.Bib_Info.Affiliations[0].SubSection = Data;
                    return true;

                case "GEOGRAPHYCONTINENT":
                case "CONTINENT":
                    Guarantee_Hierarchical_Spatial(Package).Continent = Data;
                    return true;

                case "GEOGRAPHYCOUNTRY":
                case "COUNTRY":
                    Guarantee_Hierarchical_Spatial(Package).Country = Data;
                    return true;

                case "GEOGRAPHYPROVINCE":
                case "PROVINCE":
                    Guarantee_Hierarchical_Spatial(Package).Province = Data;
                    return true;

                case "GEOGRAPHYREGION":
                case "REGION":
                    Guarantee_Hierarchical_Spatial(Package).Region = Data;
                    return true;

                case "GEOGRAPHYSTATE":
                case "STATE":
                    Guarantee_Hierarchical_Spatial(Package).State = Data;
                    return true;

                case "GEOGRAPHYTERRITORY":
                case "TERRITORY":
                    Guarantee_Hierarchical_Spatial(Package).Territory = Data;
                    return true;

                case "GEOGRAPHYCOUNTY":
                case "COUNTY":
                    Guarantee_Hierarchical_Spatial(Package).County = Data;
                    return true;

                case "GEOGRAPHYCITY":
                case "CITY":
                    Guarantee_Hierarchical_Spatial(Package).City = Data;
                    return true;

                case "GEOGRAPHYISLAND":
                case "ISLAND":
                    Guarantee_Hierarchical_Spatial(Package).Island = Data;
                    return true;

                case "GEOGRAPHYAREA":
                case "AREA":
                    Guarantee_Hierarchical_Spatial(Package).Area = Data;
                    return true;

                case "LOCATION":
                    Package.Bib_Info.Add_Spatial_Subject(Data);
                    return true;

                case "COPYRIGHTDATE":
                case "COPYRIGHT":
                    Package.Bib_Info.Origin_Info.Date_Copyrighted = Data;
                    return true;

                case "EADNAME":
                case "EAD":
                    Package.Bib_Info.Location.EAD_Name = Data;
                    return true;

                case "EADURL":
                    Package.Bib_Info.Location.EAD_URL = Data;
                    return true;

                case "COMMENTS":
                case "INTERNALCOMMENTS":
                case "INTERNAL":
                    Package.Tracking.Internal_Comments = Data;
                    return true;

                case "CONTAINERBOX":
                case "BOX":
                    Package.Bib_Info.Add_Container("Box", Data, 1);
                    return true;

                case "CONTAINERDIVIDER":
                case "DIVIDER":
                    Package.Bib_Info.Add_Container("Divider", Data, 2);
                    return true;

                case "CONTAINERFOLDER":
                case "FOLDER":
                    Package.Bib_Info.Add_Container("Folder", Data, 3);
                    return true;

                case "VIEWERS":
                case "VIEWER":
                    Package.Behaviors.Add_View(Data);
                    return true;

                case "VISIBILITY":
                    switch (Data.ToUpper())
                    {
                        case "DARK":
                            Package.Behaviors.Dark_Flag = true;
                            Package.Behaviors.IP_Restriction_Membership = -1;
                            return true;

                        case "PRIVATE":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = -1;
                            return true;

                        case "PUBLIC":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = 0;
                            return true;

                        case "RESTRICTED":
                            Package.Behaviors.Dark_Flag = false;
                            Package.Behaviors.IP_Restriction_Membership = 1;
                            return true;
                    }
                    return true;

                case "TICKLER":
                    Package.Behaviors.Add_Tickler(Data);
                    return true;

                case "TRACKINGBOX":
                    Package.Tracking.Tracking_Box = Data;
                    return true;

                case "BORNDIGITAL":
                    if (Data.ToUpper().Trim() == "TRUE")
                        Package.Tracking.Born_Digital = true;
                    return true;

                case "MATERIALRECEIVED":
                case "MATERIALRECEIVEDDATE":
                case "MATERIALRECDDATE":
                case "MATERIALRECD":
                    DateTime materialReceivedDate;
                    if (DateTime.TryParse(Data, out materialReceivedDate))
                        Package.Tracking.Material_Received_Date = materialReceivedDate;
                    return true;

                case "MATERIAL":
                case "MATERIALS":
                case "MATERIALMEDIUM":
                    VRACore_Info vraCoreInfo2 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo2 == null)
                    {
                        vraCoreInfo2 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo2);
                    }
                    vraCoreInfo2.Add_Material(Data, "medium");
                    return true;

                case "MATERIALSUPPORT":
                    VRACore_Info vraCoreInfo2b = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo2b == null)
                    {
                        vraCoreInfo2b = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo2b);
                    }
                    vraCoreInfo2b.Add_Material(Data, "support");
                    return true;

                case "MEASUREMENT":
                case "MEASUREMENTS":
                case "MEASUREMENTDIMENSIONS":
                case "MEASUREMENTSDIMENSIONS":
                case "DIMENSIONS":
                    VRACore_Info vraCoreInfo3 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo3 == null)
                    {
                        vraCoreInfo3 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo3);
                    }
                    if (vraCoreInfo3.Measurement_Count == 0)
                        vraCoreInfo3.Add_Measurement(Data, String.Empty);
                    else
                        vraCoreInfo3.Measurements[0].Measurements = Data;
                    return true;

                case "MEASUREMENTFORMAT":
                case "MEASUREMENTUNITS":
                case "MEASUREMENTSFORMAT":
                case "MEASUREMENTSUNITS":
                    VRACore_Info vraCoreInfo3b = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo3b == null)
                    {
                        vraCoreInfo3b = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo3b);
                    }
                    if (vraCoreInfo3b.Measurement_Count == 0)
                        vraCoreInfo3b.Add_Measurement(String.Empty, Data);
                    else
                        vraCoreInfo3b.Measurements[0].Units = Data;
                    return true;

                case "STATEEDITION":
                    VRACore_Info vraCoreInfo4 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo4 == null)
                    {
                        vraCoreInfo4 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo4);
                    }
                    vraCoreInfo4.Add_State_Edition(Data);
                    return true;

                case "STYLE":
                case "PERIOD":
                case "STYLEPERIOD":
                    VRACore_Info vraCoreInfo5 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo5 == null)
                    {
                        vraCoreInfo5 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo5);
                    }
                    vraCoreInfo5.Add_Style_Period(Data);
                    return true;

                case "TECHNIQUE":
                    VRACore_Info vraCoreInfo6 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo6 == null)
                    {
                        vraCoreInfo6 = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo6);
                    }
                    vraCoreInfo6.Add_Technique(Data);
                    return true;

                case "TARGETAUDIENCE":
                case "AUDIENCE":
                    Package.Bib_Info.Add_Target_Audience(Data);
                    return true;

                default:
                    // No mapping exists and this is a non-known no-mapping
                    return false;
            }
        }