public Title_Info_Form() { InitializeComponent(); showMARC = false; titleObject = new Title_Info(); statementOfResponsibility = new Note_Info(String.Empty, Note_Type_Enum.statement_of_responsibility); if (!Windows_Appearance_Checker.is_XP_Theme) { titleTypeComboBox.FlatStyle = FlatStyle.Flat; authorityComboBox.FlatStyle = FlatStyle.Flat; displayComboBox.FlatStyle = FlatStyle.Flat; languageComboBox.FlatStyle = FlatStyle.Flat; nonSortTextBox.BorderStyle = BorderStyle.FixedSingle; titleTextBox.BorderStyle = BorderStyle.FixedSingle; subTitleTextBox.BorderStyle = BorderStyle.FixedSingle; responsibilityTextBox.BorderStyle = BorderStyle.FixedSingle; partName1TextBox.BorderStyle = BorderStyle.FixedSingle; partName2TextBox.BorderStyle = BorderStyle.FixedSingle; partNumber1TextBox.BorderStyle = BorderStyle.FixedSingle; partNumber2TextBox.BorderStyle = BorderStyle.FixedSingle; titleTypeTextBox.BorderStyle = BorderStyle.FixedSingle; checkBox1.FlatStyle = FlatStyle.Flat; isXP = false; } else { isXP = true; } }
/// <summary> Saves the data stored in this instance of the /// element to the provided bibliographic object </summary> /// <param name="Bib"> Object to populate this element from </param> public override void Populate_From_Bib(SobekCM_Item Bib) { if (base.index < Bib.Bib_Info.Notes.Count) { int total_note_count = 0; int acceptable_note_count = 0; foreach (Note_Info thisNote in Bib.Bib_Info.Notes) { if ((thisNote.Note_Type == Note_Type_Enum.statement_of_responsibility) || (thisNote.Note_Type == Note_Type_Enum.default_type)) { total_note_count++; } else { total_note_count++; acceptable_note_count++; } if (acceptable_note_count == base.index + 1) { noteObject = Bib.Bib_Info.Notes[total_note_count - 1]; break; } } show_note_value(); } }
public void SetAbstract(Abstract_Info Abstract) { thisAbstract = Abstract; thisNote = null; isAbstract = true; show_values(); }
public void SetNote(Note_Info Note) { thisAbstract = null; thisNote = Note; isAbstract = false; show_values(); }
/// <summary> Map one or more data elements from the original METS-based object to the /// BriefItem object </summary> /// <param name="Original"> Original METS-based object </param> /// <param name="New"> New object to populate some data from the original </param> /// <returns> TRUE if successful, FALSE if an exception is encountered </returns> public bool MapToBriefItem(SobekCM_Item Original, BriefItemInfo New) { // Add the notes if (Original.Bib_Info.Notes_Count > 0) { Note_Info statementOfResponsibility = null; foreach (Note_Info thisNote in Original.Bib_Info.Notes) { if (thisNote.Note_Type != Note_Type_Enum.NONE) { // Statement of responsibilty will be printed at the very end if (thisNote.Note_Type == Note_Type_Enum.StatementOfResponsibility) { statementOfResponsibility = thisNote; } else { if (thisNote.Note_Type != Note_Type_Enum.InternalComments) { BriefItem_DescTermValue newAbstract = New.Add_Description("Note", thisNote.Note); newAbstract.SubTerm = thisNote.Note_Type_Display_String; if (!String.IsNullOrWhiteSpace(thisNote.Display_Label)) { newAbstract.SubTerm = thisNote.Display_Label; } } } } else { New.Add_Description("Note", thisNote.Note); } } // If there was a statement of responsibility, add it now if (statementOfResponsibility != null) { New.Add_Description("Note", statementOfResponsibility.Note).SubTerm = statementOfResponsibility.Note_Type_Display_String; } } return(true); }
/// <summary> Prepares the bib object for the save, by clearing any existing data in this element's related field(s) </summary> /// <param name="Bib"> Existing digital resource object which may already have values for this element's data field(s) </param> /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param> /// <remarks> This does nothing since there is only one type </remarks> public override void Prepare_For_Save(SobekCM_Item Bib, User_Object Current_User) { // Do nothing since there is only one type if (Bib.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.Project) { if (Bib.Bib_Info.Notes_Count > 0) { Note_Info deleteNote = null; foreach (Note_Info thisNote in Bib.Bib_Info.Notes.Where(ThisNote => ThisNote.Note_Type == Note_Type_Enum.DefaultType)) { deleteNote = thisNote; } if (deleteNote != null) { Bib.Bib_Info.Remove_Note(deleteNote); } } } }
/// <summary> Constructor for a new Note_Form_Element, used in the metadata /// template to display and allow the user to edit notes about a /// bibliographic package. </summary> public Note_Form_Element() : base("Note") { // Set the type of this object base.type = Element_Type.Note; base.display_subtype = "form"; // Set some immutable characteristics always_single = false; always_mandatory = false; base.thisBox.DoubleClick += thisBox_Click; base.thisBox.KeyDown += thisBox_KeyDown; base.thisBox.ReadOnly = true; base.thisBox.BackColor = Color.White; noteObject = new Note_Info(); noteObject.User_Submitted = true; listenForChange = false; }
/// <summary> Saves the data stored in this instance of the /// element to the provided bibliographic object </summary> /// <param name="Bib"> Object to populate this element from </param> public override void Populate_From_Bib(SobekCM_Item Bib) { if (Bib.Bib_Info.Main_Title.Title.Length > 0) { titleObject = Bib.Bib_Info.Main_Title; } // Look for the statement of responsibility note foreach (Note_Info thisNote in Bib.Bib_Info.Notes) { if (thisNote.Note_Type == Note_Type_Enum.statement_of_responsibility) { statementNote = thisNote; } } if (Bib.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.Project) { thisBox.Enabled = false; } show_title_info(); }
public Abstract_Note_Form() { InitializeComponent(); isAbstract = false; thisNote = new Note_Info(); showMARC = false; if (!Windows_Appearance_Checker.is_XP_Theme) { noteTextBox.BorderStyle = BorderStyle.FixedSingle; languageComboBox.FlatStyle = FlatStyle.Flat; subfieldTextBox.BorderStyle = BorderStyle.FixedSingle; castCheckBox.FlatStyle = FlatStyle.Flat; typeComboBox.FlatStyle = FlatStyle.Flat; checkBox1.FlatStyle = FlatStyle.Flat; isXP = false; } else { isXP = true; } }
/// <summary> Constructor for a new Main_Title_Form_Element, used in the metadata /// template to display and allow the user to edit the title of a /// bibliographic package. </summary> public Main_Title_Form_Element() : base("Title") { // Set the type of this object base.type = Element_Type.Title; base.display_subtype = "form"; // Set some immutable characteristics always_single = true; always_mandatory = true; base.thisBox.DoubleClick += thisBox_Click; base.thisBox.KeyDown += thisBox_KeyDown; base.thisBox.ReadOnly = true; base.thisBox.BackColor = Color.White; titleObject = new Title_Info(); titleObject.User_Submitted = true; statementNote = new Note_Info(); statementNote.Note_Type = Note_Type_Enum.statement_of_responsibility; statementNote.User_Submitted = true; listenForChange = false; }
/// <summary> Saves the data stored in this instance of the /// element to the provided bibliographic object </summary> /// <param name="Bib"> Object into which to save this element's data </param> public override void Save_To_Bib(SobekCM_Item Bib) { if (base.index == 0) { string input_type = base.thisBox.Text; string mods_type = String.Empty; string sobekcm_genre = String.Empty; // Step through each material type setting here foreach (Material_Type_Setting thisSetting in MetaTemplate_UserSettings.Material_Types_List) { if (String.Compare(thisSetting.Display_Name, input_type, true) == 0) { mods_type = thisSetting.MODS_Type; sobekcm_genre = thisSetting.SobekCM_Genre; break; } } // Special code if this is a PROJECT if (isProject) { // Find the existing default type note Note_Info defaultTypeNote = null; foreach (Note_Info thisNote in Bib.Bib_Info.Notes) { if (thisNote.Note_Type == Note_Type_Enum.default_type) { defaultTypeNote = thisNote; break; } } if (defaultTypeNote == null) { defaultTypeNote = new Note_Info(input_type, Note_Type_Enum.default_type); Bib.Bib_Info.Add_Note(defaultTypeNote); } else { defaultTypeNote.Note = input_type; } mods_type = "PROJECT"; sobekcm_genre = "PROJECT"; } // Was anything found? if (mods_type.Length > 0) { Bib.Bib_Info.Type.Add_Uncontrolled_Type(mods_type); if (sobekcm_genre.Length > 0) { Bib.Bib_Info.Add_Genre(sobekcm_genre, "sobekcm"); } } else { Bib.Bib_Info.Type.Add_Uncontrolled_Type(input_type); } Bib.Bib_Info.Type.Collection = collection; } else { Bib.Bib_Info.Type.Add_Uncontrolled_Type(base.thisBox.Text); } }
/// <summary> Reads the MODS-compliant section of XML and stores the data in the provided digital resource </summary> /// <param name="r"> XmlTextReader from which to read the MODS data </param> /// <param name="package"> Digital resource object to save the data to </param> public static void Read_MODS_Info(XmlReader r, Bibliographic_Info thisBibInfo, SobekCM_Item Return_Item) { while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "METS:mdWrap") || (r.Name == "mdWrap") || (r.Name == "mods"))) return; if (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "mods:abstract": case "abstract": Abstract_Info thisAbstract = new Abstract_Info(); if (r.MoveToAttribute("ID")) thisAbstract.ID = r.Value; if (r.MoveToAttribute("type")) thisAbstract.Type = r.Value; if (r.MoveToAttribute("displayLabel")) thisAbstract.Display_Label = r.Value; if (r.MoveToAttribute("lang")) thisAbstract.Language = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisAbstract.Abstract_Text = r.Value; thisBibInfo.Add_Abstract(thisAbstract); } break; case "mods:accessCondition": case "accessCondition": if (r.MoveToAttribute("ID")) thisBibInfo.Access_Condition.ID = r.Value; if (r.MoveToAttribute("type")) thisBibInfo.Access_Condition.Type = r.Value; if (r.MoveToAttribute("displayLabel")) thisBibInfo.Access_Condition.Display_Label = r.Value; if (r.MoveToAttribute("lang")) thisBibInfo.Access_Condition.Language = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Access_Condition.Text = r.Value; } break; case "mods:classification": case "classification": Classification_Info thisClassification = new Classification_Info(); if (r.MoveToAttribute("edition")) thisClassification.Edition = r.Value; if (r.MoveToAttribute("authority")) thisClassification.Authority = r.Value; if (r.MoveToAttribute("displayLabel")) thisClassification.Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisClassification.Classification = r.Value; thisBibInfo.Add_Classification(thisClassification); } break; case "mods:identifier": case "identifier": Identifier_Info thisIdentifier = new Identifier_Info(); if (r.MoveToAttribute("type")) thisIdentifier.Type = r.Value; if (r.MoveToAttribute("displayLabel")) thisIdentifier.Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisIdentifier.Identifier = r.Value; thisBibInfo.Add_Identifier(thisIdentifier); } break; case "mods:genre": case "genre": Genre_Info thisGenre = new Genre_Info(); if (r.MoveToAttribute("ID")) thisGenre.ID = r.Value; if (r.MoveToAttribute("authority")) thisGenre.Authority = r.Value; if (r.MoveToAttribute("lang")) thisGenre.Language = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisGenre.Genre_Term = r.Value; thisBibInfo.Add_Genre(thisGenre); } break; case "mods:language": case "language": string language_text = String.Empty; string language_rfc_code = String.Empty; string language_iso_code = String.Empty; string language_id = String.Empty; if (r.MoveToAttribute("ID")) language_id = r.Value; while (r.Read()) { if ((r.NodeType == XmlNodeType.Element) && ((r.Name == "mods:languageTerm") || (r.Name == "languageTerm"))) { if (r.MoveToAttribute("type")) { switch (r.Value) { case "code": if (r.MoveToAttribute("authority")) { if (r.Value == "rfc3066") { r.Read(); if (r.NodeType == XmlNodeType.Text) { language_rfc_code = r.Value; } } else if (r.Value == "iso639-2b") { r.Read(); if (r.NodeType == XmlNodeType.Text) { language_iso_code = r.Value; } } } break; case "text": r.Read(); if (r.NodeType == XmlNodeType.Text) { language_text = r.Value; } // Quick check for a change we started in 2010 if (language_text == "governmental publication") language_text = "government publication"; break; default: r.Read(); if (r.NodeType == XmlNodeType.Text) { language_text = r.Value; } break; } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { language_text = r.Value; } } } if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:language") || (r.Name == "language"))) { break; } } if ((language_text.Length > 0) || (language_rfc_code.Length > 0) || (language_iso_code.Length > 0)) { thisBibInfo.Add_Language(language_text, language_iso_code, language_rfc_code); } break; case "mods:location": case "location": while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:location") || (r.Name == "location"))) break; if (r.NodeType == XmlNodeType.Element) { if ((r.Name == "mods:physicalLocation") || (r.Name == "physicalLocation")) { if (r.MoveToAttribute("type")) { if (r.Value == "code") { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Location.Holding_Code = r.Value; } } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Location.Holding_Name = r.Value; } } } if ((r.Name == "mods:url") || (r.Name == "url")) { // TEST if (r.MoveToAttribute("access")) { if (r.Value == "object in context") { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Location.PURL = r.Value; } } } else { string url_displayLabel = r.GetAttribute("displayLabel"); string url_note = r.GetAttribute("note"); r.Read(); if (r.NodeType == XmlNodeType.Text) { if ((url_displayLabel != null) && (url_displayLabel == "Finding Guide")) { if (url_note != null) { thisBibInfo.Location.EAD_Name = url_note; } thisBibInfo.Location.EAD_URL = r.Value; } else { if (url_displayLabel != null) { thisBibInfo.Location.Other_URL_Display_Label = url_displayLabel; } if (url_note != null) { thisBibInfo.Location.Other_URL_Note = url_note; } thisBibInfo.Location.Other_URL = r.Value; } } } } } } break; case "mods:name": case "name": Name_Info tempNewName = read_name_object(r); if (tempNewName.Main_Entity) thisBibInfo.Main_Entity_Name = tempNewName; else { bool donor = false; foreach (Name_Info_Role role in tempNewName.Roles) { if ((role.Role == "donor") || (role.Role == "honoree") || (role.Role == "endowment") || (role.Role == "collection")) { donor = true; break; } } if (donor) { thisBibInfo.Donor = tempNewName; } else { thisBibInfo.Add_Named_Entity(tempNewName); } } break; case "mods:note": case "note": Note_Info newNote = new Note_Info(); if (r.MoveToAttribute("ID")) newNote.ID = r.Value; if (r.MoveToAttribute("type")) newNote.Note_Type_String = r.Value; if (r.MoveToAttribute("displayLabel")) newNote.Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { newNote.Note = r.Value; thisBibInfo.Add_Note(newNote); } break; case "mods:Origin_Info": case "Origin_Info": case "mods:originInfo": case "originInfo": while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:Origin_Info") || (r.Name == "Origin_Info") || (r.Name == "mods:originInfo") || (r.Name == "originInfo"))) break; if (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "mods:publisher": case "publisher": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Add_Publisher(r.Value); thisBibInfo.Add_Publisher(r.Value); } break; case "mods:place": case "place": string place_text = String.Empty; string place_marc = String.Empty; string place_iso = String.Empty; while ((r.Read()) && (!(((r.Name == "mods:place") || (r.Name == "place")) && (r.NodeType == XmlNodeType.EndElement)))) { if ((r.NodeType == XmlNodeType.Element) && ((r.Name == "mods:placeTerm") || (r.Name == "placeTerm"))) { if ((r.MoveToAttribute("type")) && (r.Value == "code")) { if (r.MoveToAttribute("authority")) { switch (r.Value) { case "marccountry": r.Read(); if (r.NodeType == XmlNodeType.Text) { place_marc = r.Value; } break; case "iso3166": r.Read(); if (r.NodeType == XmlNodeType.Text) { place_iso = r.Value; } break; } } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { place_text = r.Value; } } } } if ((place_text.Length > 0) || (place_marc.Length > 0) || (place_iso.Length > 0)) { thisBibInfo.Origin_Info.Add_Place(place_text, place_marc, place_iso); } break; case "mods:dateIssued": case "dateIssued": if ((r.MoveToAttribute("encoding")) && (r.Value == "marc")) { if (r.MoveToAttribute("point")) { if (r.Value == "start") { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.MARC_DateIssued_Start = r.Value; } } else if (r.Value == "end") { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.MARC_DateIssued_End = r.Value; } } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.MARC_DateIssued = r.Value; } } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Date_Issued = r.Value; } } break; case "mods:dateCreated": case "dateCreated": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Date_Created = r.Value; } break; case "mods:copyrightDate": case "copyrightDate": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Date_Copyrighted = r.Value; } break; case "mods:dateOther": case "dateOther": if ((r.MoveToAttribute("type")) && (r.Value == "reprint")) { r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Date_Reprinted = r.Value; } } break; case "mods:edition": case "edition": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Edition = r.Value; } break; case "mods:frequency": case "frequency": string freq_authority = String.Empty; if (r.MoveToAttribute("authority")) freq_authority = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Add_Frequency(r.Value, freq_authority); } break; case "mods:issuance": case "issuance": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Origin_Info.Add_Issuance(r.Value); } break; } } } break; case "mods:physicalDescription": case "physicalDescription": read_physical_description(r, thisBibInfo.Original_Description); break; case "mods:recordInfo": case "recordInfo": while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:recordInfo") || (r.Name == "recordInfo"))) { break; } if (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "mods:recordCreationDate": case "recordCreationDate": if ((r.MoveToAttribute("encoding")) && (r.Value == "marc")) { r.Read(); thisBibInfo.Record.MARC_Creation_Date = r.Value; } break; case "mods:recordIdentifier": case "recordIdentifier": string source = String.Empty; if (r.MoveToAttribute("source")) { thisBibInfo.Record.Main_Record_Identifier.Type = r.Value; } r.Read(); thisBibInfo.Record.Main_Record_Identifier.Identifier = r.Value; break; case "mods:recordOrigin": case "recordOrigin": r.Read(); thisBibInfo.Record.Record_Origin = r.Value; break; case "mods:descriptionStandard": case "descriptionStandard": r.Read(); thisBibInfo.Record.Description_Standard = r.Value; break; case "mods:recordContentSource": case "recordContentSource": if (r.MoveToAttribute("authority")) { if (r.Value == "marcorg") { r.Read(); thisBibInfo.Record.Add_MARC_Record_Content_Sources(r.Value); } } else { r.Read(); thisBibInfo.Source.Statement = r.Value; } break; case "mods:languageOfCataloging": case "languageOfCataloging": string cat_language_text = String.Empty; string cat_language_rfc_code = String.Empty; string cat_language_iso_code = String.Empty; string cat_language_id = String.Empty; while (r.Read()) { if ((r.NodeType == XmlNodeType.Element) && ((r.Name == "mods:languageTerm") || (r.Name == "languageTerm"))) { if (r.MoveToAttribute("ID")) cat_language_id = r.Value; if (r.MoveToAttribute("type")) { switch (r.Value) { case "code": if (r.MoveToAttribute("authority")) { if (r.Value == "rfc3066") { r.Read(); if (r.NodeType == XmlNodeType.Text) { cat_language_rfc_code = r.Value; } } else if (r.Value == "iso639-2b") { r.Read(); if (r.NodeType == XmlNodeType.Text) { cat_language_iso_code = r.Value; } } } break; case "text": r.Read(); if (r.NodeType == XmlNodeType.Text) { cat_language_text = r.Value; } break; default: r.Read(); if (r.NodeType == XmlNodeType.Text) { cat_language_text = r.Value; } break; } } else { r.Read(); if (r.NodeType == XmlNodeType.Text) { cat_language_text = r.Value; } } } if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:languageOfCataloging") || (r.Name == "languageOfCataloging"))) { break; } } if ((cat_language_text.Length > 0) || (cat_language_rfc_code.Length > 0) || (cat_language_iso_code.Length > 0)) { Language_Info newCatLanguage = new Language_Info(cat_language_text, cat_language_iso_code, cat_language_rfc_code); thisBibInfo.Record.Add_Catalog_Language(newCatLanguage); } break; } } } break; case "mods:relatedItem": case "relatedItem": string relatedItemType = String.Empty; if (r.MoveToAttribute("type")) relatedItemType = r.Value.ToLower(); switch (relatedItemType) { case "original": while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:relatedItem") || (r.Name == "relatedItem"))) break; if (r.NodeType == XmlNodeType.Element) { if ((r.Name == "mods:physicalDescription") || (r.Name == "physicalDescription")) { read_physical_description(r, thisBibInfo.Original_Description); } } } break; case "series": string part_type = String.Empty; string part_caption = String.Empty; string part_number = String.Empty; while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:relatedItem") || (r.Name == "mods:relatedItem"))) { break; } if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:detail") || (r.Name == "detail"))) { try { switch (part_type) { case "Enum1": thisBibInfo.Series_Part_Info.Enum1 = part_caption; thisBibInfo.Series_Part_Info.Enum1_Index = Convert.ToInt32(part_number); break; case "Enum2": thisBibInfo.Series_Part_Info.Enum2 = part_caption; thisBibInfo.Series_Part_Info.Enum2_Index = Convert.ToInt32(part_number); break; case "Enum3": thisBibInfo.Series_Part_Info.Enum3 = part_caption; thisBibInfo.Series_Part_Info.Enum3_Index = Convert.ToInt32(part_number); break; case "Enum4": thisBibInfo.Series_Part_Info.Enum4 = part_caption; thisBibInfo.Series_Part_Info.Enum4_Index = Convert.ToInt32(part_number); break; case "Year": thisBibInfo.Series_Part_Info.Year = part_caption; thisBibInfo.Series_Part_Info.Year_Index = Convert.ToInt32(part_number); break; case "Month": thisBibInfo.Series_Part_Info.Month = part_caption; thisBibInfo.Series_Part_Info.Month_Index = Convert.ToInt32(part_number); break; case "Day": thisBibInfo.Series_Part_Info.Day = part_caption; thisBibInfo.Series_Part_Info.Day_Index = Convert.ToInt32(part_number); break; } } catch { } part_type = String.Empty; part_caption = String.Empty; part_number = String.Empty; } if (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "mods:titleInfo": case "titleInfo": thisBibInfo.SeriesTitle = read_title_object(r); break; case "mods:detail": case "detail": if (r.MoveToAttribute("type")) { part_type = r.Value; } break; case "mods:caption": case "caption": r.Read(); if (r.NodeType == XmlNodeType.Text) { part_caption = r.Value; } break; case "mods:number": case "number": r.Read(); if (r.NodeType == XmlNodeType.Text) { part_number = r.Value; } break; } } } break; default: Related_Item_Info newRelated = new Related_Item_Info(); thisBibInfo.Add_Related_Item(newRelated); switch (relatedItemType) { case "preceding": newRelated.Relationship = Related_Item_Type_Enum.preceding; break; case "succeeding": newRelated.Relationship = Related_Item_Type_Enum.succeeding; break; case "otherVersion": newRelated.Relationship = Related_Item_Type_Enum.otherVersion; break; case "otherFormat": newRelated.Relationship = Related_Item_Type_Enum.otherFormat; break; case "host": newRelated.Relationship = Related_Item_Type_Enum.host; break; } if (r.MoveToAttribute("ID")) newRelated.ID = r.Value; while (r.Read()) { if ((r.NodeType == XmlNodeType.EndElement) && ((r.Name == "mods:relatedItem") || (r.Name == "relatedItem"))) { break; } if (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "mods:titleInfo": case "titleInfo": newRelated.Set_Main_Title(read_title_object(r)); break; case "mods:identifier": case "identifier": Identifier_Info thisRIdentifier = new Identifier_Info(); if (r.MoveToAttribute("type")) thisRIdentifier.Type = r.Value; if (r.MoveToAttribute("displayLabel")) thisRIdentifier.Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { thisRIdentifier.Identifier = r.Value; newRelated.Add_Identifier(thisRIdentifier); } break; case "mods:name": case "name": newRelated.Add_Name(read_name_object(r)); break; case "mods:note": case "note": Note_Info newRNote = new Note_Info(); if (r.MoveToAttribute("ID")) newRNote.ID = r.Value; if (r.MoveToAttribute("type")) newRNote.Note_Type_String = r.Value; if (r.MoveToAttribute("displayLabel")) newRNote.Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { newRNote.Note = r.Value; newRelated.Add_Note(newRNote); } break; case "mods:url": case "url": if (r.MoveToAttribute("displayLabel")) newRelated.URL_Display_Label = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { newRelated.URL = r.Value; } break; case "mods:publisher": case "publisher": r.Read(); if (r.NodeType == XmlNodeType.Text) { newRelated.Publisher = r.Value; } break; case "mods:recordIdentifier": case "recordIdentifier": if (r.MoveToAttribute("source")) { if ((r.Value == "ufdc") || (r.Value == "dloc") || (r.Value.ToLower() == "sobekcm")) { r.Read(); if (r.NodeType == XmlNodeType.Text) { newRelated.SobekCM_ID = r.Value; } } } break; case "mods:dateIssued": case "dateIssued": if (r.MoveToAttribute("point")) { if (r.Value == "start") { r.Read(); if (r.NodeType == XmlNodeType.Text) { newRelated.Start_Date = r.Value; } } else if (r.Value == "end") { r.Read(); if (r.NodeType == XmlNodeType.Text) { newRelated.End_Date = r.Value; } } } break; } } } break; } break; case "mods:subject": case "subject": read_subject_object(r, thisBibInfo); break; case "mods:targetAudience": case "targetAudience": TargetAudience_Info newTarget = new TargetAudience_Info(); if (r.MoveToAttribute("ID")) newTarget.ID = r.Value; if (r.MoveToAttribute("authority")) newTarget.Authority = r.Value; r.Read(); if (r.NodeType == XmlNodeType.Text) { newTarget.Audience = r.Value; thisBibInfo.Add_Target_Audience(newTarget); } break; case "mods:tableOfContents": case "tableOfContents": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.TableOfContents = r.Value; } break; case "mods:titleInfo": case "titleInfo": Title_Info thisTitle = read_title_object(r); if (thisTitle.Title_Type == Title_Type_Enum.UNSPECIFIED) thisBibInfo.Main_Title = thisTitle; else thisBibInfo.Add_Other_Title(thisTitle); break; case "mods:typeOfResource": case "typeOfResource": r.Read(); if (r.NodeType == XmlNodeType.Text) { thisBibInfo.Type.Add_Uncontrolled_Type(r.Value); } break; case "mods:extension": case "extension": string schema = String.Empty; string alias = String.Empty; if (r.HasAttributes) { for (int i = 0; i < r.AttributeCount; i++) { r.MoveToAttribute(i); if (r.Name.IndexOf("xmlns") == 0) { alias = r.Name.Replace("xmlns:", ""); schema = r.Value; break; } } } if (schema.IndexOf("vra.xsd") > 0) { read_vra_core_extensions(r, thisBibInfo, alias, Return_Item); } break; } } } }
/// <summary> Removes a single note from the collection of notes associated with this digital resource </summary> /// <param name="Note"> Note to remove </param> public void Remove_Note(Note_Info Note) { if ((notes != null) && (notes.Contains(Note))) notes.Remove(Note); }
/// <summary> Add a new note which describes either this digital resource or the original item </summary> /// <param name="Note">Text of the note</param> /// <param name="Note_Type">Type of Note</param> /// <param name="Display_Label">Display Label for this note</param> /// <returns>Newly built and added note object</returns> public Note_Info Add_Note(string Note, string Note_Type, string Display_Label) { if (notes == null) notes = new List<Note_Info>(); Note_Info newNote = new Note_Info(Note, Note_Type, Display_Label); if (!notes.Contains(newNote)) { notes.Add(newNote); return newNote; } else { Note_Info returnNote = notes.Find(newNote.Equals); if (Display_Label.Length > 0) { returnNote.Display_Label = Display_Label; } return returnNote; } }
/// <summary> Add a new note which describes either this digital resource or the original item </summary> /// <param name="Note">Text of the note</param> /// <param name="Note_Type">Type of Note</param> /// <returns>Newly built and added note object</returns> public Note_Info Add_Note(string Note, Note_Type_Enum Note_Type) { if (notes == null) notes = new List<Note_Info>(); Note_Info newNote = new Note_Info(Note, Note_Type); if (!notes.Contains(newNote)) { notes.Add(newNote); return newNote; } else { return notes.Find(newNote.Equals); } }
/// <summary> Saves the data stored in this instance of the /// element to the provided bibliographic object </summary> /// <param name="Bib"> Object into which to save this element's data </param> public override void Save_To_Bib(SobekCM_Item Bib) { if (!read_only) { string input_type = base.thisCodeBox.Text; string mods_type = String.Empty; string sobekcm_genre = String.Empty; // Step through each material type setting here foreach (Material_Type_Setting thisSetting in MetaTemplate_UserSettings.Material_Types_List) { if (String.Compare(thisSetting.Display_Name, input_type, true) == 0) { mods_type = thisSetting.MODS_Type; sobekcm_genre = thisSetting.SobekCM_Genre; break; } } // Special code if this is a PROJECT if (isProject) { // Find the existing default type note Note_Info defaultTypeNote = null; foreach (Note_Info thisNote in Bib.Bib_Info.Notes) { if (thisNote.Note_Type == Note_Type_Enum.default_type) { defaultTypeNote = thisNote; break; } } if (defaultTypeNote == null) { defaultTypeNote = new Note_Info(input_type, Note_Type_Enum.default_type); Bib.Bib_Info.Add_Note(defaultTypeNote); } else { defaultTypeNote.Note = input_type; } Bib.Bib_Info.Add_Genre("project", "sobekcm"); Bib.Bib_Info.Type.Clear(); } else { // Was anything found? if (mods_type.Length > 0) { Bib.Bib_Info.Type.Add_Uncontrolled_Type(mods_type); if (sobekcm_genre.Length > 0) { Bib.Bib_Info.Add_Genre(sobekcm_genre, "sobekcm"); } } else { Bib.Bib_Info.Type.Add_Uncontrolled_Type(input_type); } } Bib.Bib_Info.Type.Collection = collection; Bib.Bib_Info.Original_Description.Extent = extent; Bib.Bib_Info.Origin_Info.MARC_DateIssued_End = marc_date_end; Bib.Bib_Info.Origin_Info.MARC_DateIssued_Start = marc_date_start; Bib.Bib_Info.Origin_Info.Add_Place(String.Empty, place_code, String.Empty); Bib.Bib_Info.Add_Language(String.Empty, language_code, String.Empty); foreach (Origin_Info_Frequency thisFrequency in frequency_collection) { Bib.Bib_Info.Origin_Info.Add_Frequency(thisFrequency); } foreach (Genre_Info thisGenre in genre_collection) { Bib.Bib_Info.Add_Genre(thisGenre); } foreach (TargetAudience_Info thisAudience in audience_collection) { Bib.Bib_Info.Add_Target_Audience(thisAudience); } foreach (Subject_Info thisSubject in cartographics) { Bib.Bib_Info.Add_Subject(thisSubject); } } }
public void SetTitle(Title_Info Title_Object, Note_Info Statement_Of_Responsibility, bool mainTitle, bool seriesTitle, bool subjectTitle) { titleTypeComboBox.SelectedIndexChanged -= titleTypeComboBox_SelectedIndexChanged; // Save this title object titleObject = Title_Object; //// Set the MARC field //marc_field = 245; //if (seriesTitle) // marc_field = 490; //if (subjectTitle) // marc_field = 630; if (mainTitle) { titleTypeComboBox.Hide(); titleTypeTextBox.Show(); titleTypeTextBox.Text = "Main Title"; displayComboBox.Hide(); displayLabel.Hide(); responsibilityLabel.Show(); responsibilityTextBox.Show(); if (Statement_Of_Responsibility != null) { statementOfResponsibility = Statement_Of_Responsibility; responsibilityTextBox.Text = statementOfResponsibility.Note; } } else { responsibilityLabel.Hide(); responsibilityTextBox.Hide(); if ((seriesTitle) || (subjectTitle)) { titleTypeComboBox.Hide(); titleTypeTextBox.Show(); if (seriesTitle) { titleTypeTextBox.Text = "Series Title"; } else { titleTypeTextBox.Text = "Subject"; } displayComboBox.Hide(); displayLabel.Hide(); } else { switch (titleObject.Title_Type) { case Title_Type_Enum.abbreviated: titleTypeComboBox.Show(); titleTypeTextBox.Hide(); titleTypeComboBox.Items.Clear(); titleTypeComboBox.Items.Add("Abbreviated"); titleTypeComboBox.Items.Add("Alternative"); titleTypeComboBox.Items.Add("Translated"); titleTypeComboBox.SelectedIndex = 0; displayComboBox.Hide(); displayLabel.Hide(); break; case Title_Type_Enum.alternative: case Title_Type_Enum.UNSPECIFIED: titleTypeComboBox.Show(); titleTypeTextBox.Hide(); titleTypeComboBox.Items.Clear(); titleTypeComboBox.Items.Add("Abbreviated"); titleTypeComboBox.Items.Add("Alternative"); titleTypeComboBox.Items.Add("Translated"); titleTypeComboBox.SelectedIndex = 1; displayComboBox.Show(); displayLabel.Show(); displayComboBox.Items.Clear(); displayComboBox.Items.Add("Added title page title"); displayComboBox.Items.Add("Alternate title"); displayComboBox.Items.Add("Caption title"); displayComboBox.Items.Add("Cover title"); displayComboBox.Items.Add("Distinctive title"); displayComboBox.Items.Add("Other title"); displayComboBox.Items.Add("Portion of title"); displayComboBox.Items.Add("Parallel title"); displayComboBox.Items.Add("Running title"); displayComboBox.Items.Add("Spine title"); if (displayComboBox.Items.Contains(titleObject.Display_Label)) { displayComboBox.Text = titleObject.Display_Label; } else { displayComboBox.Text = "Alternate title"; } break; case Title_Type_Enum.translated: titleTypeComboBox.Show(); titleTypeTextBox.Hide(); titleTypeComboBox.Items.Clear(); titleTypeComboBox.Items.Add("Abbreviated"); titleTypeComboBox.Items.Add("Alternative"); titleTypeComboBox.Items.Add("Translated"); titleTypeComboBox.SelectedIndex = 2; displayComboBox.Hide(); displayLabel.Hide(); break; case Title_Type_Enum.uniform: titleTypeComboBox.Hide(); titleTypeTextBox.Show(); titleTypeTextBox.Text = "Uniform"; displayComboBox.Show(); displayLabel.Show(); displayComboBox.Items.Clear(); displayComboBox.Items.Add("Main Entry"); displayComboBox.Items.Add("Uncontrolled Added Entry"); displayComboBox.Items.Add("Uniform Title"); if (displayComboBox.Items.Contains(titleObject.Display_Label)) { displayComboBox.Text = titleObject.Display_Label; } else { displayComboBox.Text = "Uniform Title"; } break; } } } // Set all the values appropriately nonSortTextBox.Text = titleObject.NonSort; titleTextBox.Text = titleObject.Title; subTitleTextBox.Text = titleObject.Subtitle; languageComboBox.Text = titleObject.Language; authorityComboBox.Text = titleObject.Authority; if (titleObject.Part_Names.Count > 0) { partName1TextBox.Text = titleObject.Part_Names[0]; } if (titleObject.Part_Names.Count > 1) { partName2TextBox.Text = titleObject.Part_Names[1]; } if (titleObject.Part_Numbers.Count > 0) { partNumber1TextBox.Text = titleObject.Part_Numbers[0]; } if (titleObject.Part_Names.Count > 1) { partNumber2TextBox.Text = titleObject.Part_Numbers[1]; } titleTypeComboBox.SelectedIndexChanged += titleTypeComboBox_SelectedIndexChanged; titleTypeComboBox.TextChanged += textChanged; authorityComboBox.TextChanged += textChanged; displayComboBox.TextChanged += textChanged; languageComboBox.TextChanged += textChanged; nonSortTextBox.TextChanged += textChanged; titleTextBox.TextChanged += textChanged; subTitleTextBox.TextChanged += textChanged; responsibilityTextBox.TextChanged += textChanged; partName1TextBox.TextChanged += textChanged; partName2TextBox.TextChanged += textChanged; partNumber1TextBox.TextChanged += textChanged; partNumber2TextBox.TextChanged += textChanged; titleTypeTextBox.TextChanged += textChanged; }
/// <summary> Adds a new note to this related item </summary> /// <param name="Note">Note associated with this related item </param> public void Add_Note(Note_Info Note) { if (notes == null) notes = new List<Note_Info>(); notes.Add(Note); }
/// <summary> Add a new note which describes either this digital resource or the original item </summary> /// <param name="New_Note">Note object</param> public void Add_Note(Note_Info New_Note) { if (notes == null) notes = new List<Note_Info>(); if (!notes.Contains(New_Note)) { notes.Add(New_Note); } }