/// <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.thisKeywordBox.Text.Trim().Length > 0) { Subject_Info_HierarchicalGeographic newSpatial = new Subject_Info_HierarchicalGeographic(); newSpatial.Area = base.thisKeywordBox.Text.Trim(); newSpatial.Authority = base.thisSchemeBox.Text.Trim(); Bib.Bib_Info.Add_Subject(newSpatial); } }
/// <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; foreach (string thisKey in getKeys) { if (thisKey.IndexOf("formspatialcontinent_") == 0) { string diff = thisKey.Replace("formspatialcontinent_", ""); string continent = HttpContext.Current.Request.Form[thisKey]; string country = HttpContext.Current.Request.Form["formspatialcountry_" + diff].Trim(); string province = HttpContext.Current.Request.Form["formspatialprovince_" + diff].Trim(); string region = HttpContext.Current.Request.Form["formspatialregion_" + diff].Trim(); string state = HttpContext.Current.Request.Form["formspatialstate_" + diff].Trim(); string territory = HttpContext.Current.Request.Form["formspatialterritory_" + diff].Trim(); string county = HttpContext.Current.Request.Form["formspatialcounty_" + diff].Trim(); string city = HttpContext.Current.Request.Form["formspatialcity_" + diff].Trim(); string citysection = HttpContext.Current.Request.Form["formspatialsectioncity_" + diff].Trim(); string island = HttpContext.Current.Request.Form["formspatialisland_" + diff].Trim(); string area = HttpContext.Current.Request.Form["formspatialarea_" + diff].Trim(); string authority = HttpContext.Current.Request.Form["formspatialauthority_" + diff].Trim(); string language = HttpContext.Current.Request.Form["formspatiallanguage_" + diff].Trim(); string type = HttpContext.Current.Request.Form["formspatialtype_" + diff].Trim(); if ((area.Length > 0) || (continent.Length > 0) || (country.Length > 0) || (province.Length > 0) || (region.Length > 0) || (state.Length > 0) || (territory.Length > 0) || (county.Length > 0) || (city.Length > 0) || (island.Length > 0)) { Subject_Info_HierarchicalGeographic newSubject = new Subject_Info_HierarchicalGeographic { Continent = continent, Country = country, Province = province, Region = region, State = state, Territory = territory, County = county, City = city, CitySection = citysection, Island = island, Area = area, Authority = authority, Language = language, ID = type == "addedentry" ? "SUBJ752" : "SUBJ662" }; Bib.Bib_Info.Add_Subject(newSubject); } } } }
/// <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; foreach (string thisKey in getKeys) { if (thisKey.IndexOf(html_element_name.Replace("_", "")) == 0) { Subject_Info_HierarchicalGeographic hierarchy = Bib.Bib_Info.Add_Hierarchical_Geographic_Subject(); hierarchy.ID = "SUBJ662"; hierarchy.Area = HttpContext.Current.Request.Form[thisKey]; } } }
/// <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.thisBox.Text.Trim().Length > 0) { if (dublinCore) { Subject_Info_Standard newStandard = new Subject_Info_Standard(); newStandard.Add_Geographic(base.thisBox.Text.Trim()); Bib.Bib_Info.Add_Subject(newStandard); } else { Subject_Info_HierarchicalGeographic newSpatial = new Subject_Info_HierarchicalGeographic(); newSpatial.Area = base.thisBox.Text.Trim(); Bib.Bib_Info.Add_Subject(newSpatial); } } }
/// <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) { int hierarchical_index = -1; for (int i = 0; i < Bib.Bib_Info.Subjects.Count; i++) { if (Bib.Bib_Info.Subjects[i].Class_Type == Subject_Info_Type.Hierarchical_Spatial) { hierarchical_index++; if (hierarchical_index == base.index) { geoObject = (Subject_Info_HierarchicalGeographic)Bib.Bib_Info.Subjects[i]; base.thisBox.Text = geoObject.ToString(); break; } } } }
/// <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) { int hierarchical_index = -1; for (int i = 0; i < Bib.Bib_Info.Subjects.Count; i++) { if (Bib.Bib_Info.Subjects[i].Class_Type == Subject_Info_Type.Hierarchical_Spatial) { hierarchical_index++; if (hierarchical_index == base.index) { Subject_Info_HierarchicalGeographic hierSubject = (Subject_Info_HierarchicalGeographic)Bib.Bib_Info.Subjects[i]; base.thisKeywordBox.Text = hierSubject.Area; base.thisSchemeBox.Text = hierSubject.Authority; break; } } } }
private static Subject_Info_HierarchicalGeographic Guarantee_Hierarchical_Spatial(SobekCM_Item Package) { // Is there an existing hierarchical? if (Package.Bib_Info.Subjects_Count > 0) { foreach (Subject_Info subject in Package.Bib_Info.Subjects) { if (subject.Class_Type == Subject_Info_Type.Hierarchical_Spatial) { return((Subject_Info_HierarchicalGeographic)subject); } } } // Add a spatial, if none exists Subject_Info_HierarchicalGeographic hierarchical = new Subject_Info_HierarchicalGeographic(); Package.Bib_Info.Add_Subject(hierarchical); return(hierarchical); }
/// <summary> Constructor for a new Creator_Simple_Element, used in the metadata /// template to display and allow the user to edit the creator's name of a /// bibliographic package. </summary> public Hierarchical_Geography_Form_Element() : base("Hierarchical Geographic") { // Set the type of this object base.type = Element_Type.Spatial; 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; geoObject = new Subject_Info_HierarchicalGeographic(); geoObject.User_Submitted = true; listenForChange = false; }
public void SetGeography(Subject_Info_HierarchicalGeographic GeoObject) { thisSubject = GeoObject; areaTextBox.Text = thisSubject.Area; islandTextBox.Text = thisSubject.Island; cityTextBox.Text = thisSubject.City; countyTextBox.Text = thisSubject.County; countryTextBox.Text = thisSubject.Country; territoryTextBox.Text = thisSubject.Territory; stateTextBox.Text = thisSubject.State; regionTextBox.Text = thisSubject.Region; provinceTextBox.Text = thisSubject.Province; continentTextBox.Text = thisSubject.Continent; authorityComboBox.Text = thisSubject.Authority; if (thisSubject.ID.IndexOf("SUBJ752") >= 0) { addedEntryRadioButton.Checked = true; } else { subjectRadioButton.Checked = true; } areaTextBox.TextChanged += textChanged; islandTextBox.TextChanged += textChanged; cityTextBox.TextChanged += textChanged; countyTextBox.TextChanged += textChanged; countryTextBox.TextChanged += textChanged; territoryTextBox.TextChanged += textChanged; stateTextBox.TextChanged += textChanged; regionTextBox.TextChanged += textChanged; provinceTextBox.TextChanged += textChanged; continentTextBox.TextChanged += textChanged; authorityComboBox.TextChanged += textChanged; languageComboBox.TextChanged += textChanged; addedEntryRadioButton.CheckedChanged += checkedChanged; subjectRadioButton.CheckedChanged += checkedChanged; }
private void process_bib_desc(XmlNodeReader nodeReader, SobekCM_Item thisPackage) { // Set some counters for the creator role/date and contributor role/date int creatorRole = 0; int creatorDate = 0; //int contribRole = 0; //int contribDate = 0; // Read all the nodes while (nodeReader.Read()) { // If this is the end tag for bibDesc, return if ((nodeReader.NodeType == XmlNodeType.EndElement) && (nodeReader.Name.Trim().ToUpper() == "BIBDESC")) { return; } // If this is the beginning tag for an element, assign the next values accordingly if (nodeReader.NodeType == XmlNodeType.Element) { // Switch based on the element name switch (nodeReader.Name.Trim().ToUpper()) { case "DC.TITLE": thisPackage.Bib_Info.Main_Title.Title = read_text_node(nodeReader); break; case "DC.RIGHTS": thisPackage.Bib_Info.Access_Condition.Text = read_text_node(nodeReader); break; case "DC.IDENTIFIER": thisPackage.Bib_Info.Add_Identifier(read_text_node(nodeReader)); break; case "DC.DATE": thisPackage.Bib_Info.Origin_Info.Date_Issued = read_text_node(nodeReader); break; case "DC.CREATOR": thisPackage.Bib_Info.Add_Named_Entity(read_text_node(nodeReader), "creator"); break; case "PALMM.CREATORROLE": if (thisPackage.Bib_Info.Names_Count > creatorRole) { if (thisPackage.Bib_Info.Names[creatorRole].Roles.Count == 0) { thisPackage.Bib_Info.Names[creatorRole].Roles.Add(new Name_Info_Role(read_text_node(nodeReader), Name_Info_Role_Type_Enum.text)); } else { thisPackage.Bib_Info.Names[creatorRole].Roles[0].Role = read_text_node(nodeReader); } creatorRole++; } break; case "PALMM.CREATORDATES": if (thisPackage.Bib_Info.Names_Count > creatorDate) { thisPackage.Bib_Info.Names[creatorDate++].Dates = read_text_node(nodeReader); } break; case "DC.CONTRIBUTOR": thisPackage.Bib_Info.Add_Named_Entity(new Name_Info(read_text_node(nodeReader), "contributor")); break; case "DC.DESCRIPTION": thisPackage.Bib_Info.Add_Note(new Note_Info(read_text_node(nodeReader))); break; case "DC.SUBJECT": if (nodeReader.HasAttributes) { nodeReader.MoveToAttribute(0); string scheme = nodeReader.Value.Trim(); thisPackage.Bib_Info.Add_Subject(new Subject_Info_Standard(read_text_node(nodeReader), scheme)); } else { thisPackage.Bib_Info.Add_Subject(new Subject_Info_Standard(read_text_node(nodeReader), String.Empty)); } break; case "PALMM.SPATIALNAME": if (nodeReader.HasAttributes) { nodeReader.MoveToAttribute(0); string scheme = nodeReader.Value.Trim(); Subject_Info_HierarchicalGeographic thisSpatial = new Subject_Info_HierarchicalGeographic(); thisSpatial.Authority = scheme; thisSpatial.Area = read_text_node(nodeReader); thisPackage.Bib_Info.Add_Subject(thisSpatial); } else { Subject_Info_HierarchicalGeographic thisSpatial = new Subject_Info_HierarchicalGeographic(); thisSpatial.Area = read_text_node(nodeReader); thisPackage.Bib_Info.Add_Subject(thisSpatial); } break; case "DC.FORMAT.EXTENT": thisPackage.Bib_Info.Original_Description.Extent = read_text_node(nodeReader); break; case "DC.TYPE": if (thisPackage.Bib_Info.Original_Description.Extent.Length > 0) { thisPackage.Bib_Info.Original_Description.Extent = read_text_node(nodeReader) + " ( " + thisPackage.Bib_Info.Original_Description.Extent + " )"; } else { thisPackage.Bib_Info.Original_Description.Extent = read_text_node(nodeReader); } break; case "PALMM.LOCATION": thisPackage.Bib_Info.Location.Holding_Name = read_text_node(nodeReader); break; case "PALMM.NOTES": thisPackage.Bib_Info.Add_Note(read_text_node(nodeReader)); break; } } } }
/// <summary> Constructor for a new instance of the SolrDocument class </summary> /// <param name="Digital_Object"> Digital object to create an easily indexable view object for </param> /// <param name="File_Location"> Location for all of the text files associated with this item </param> /// <remarks> Some work is done in the constructor; in particular, work that eliminates the number of times /// iterations must be made through objects which may be indexed in a number of places. /// This includes subject keywords, spatial information, genres, and information from the table of contents </remarks> public SolrDocument(SobekCM_Item Digital_Object, string File_Location) { digitalObject = Digital_Object; fileLocation = File_Location; // Add the subjects if (digitalObject.Bib_Info.Subjects_Count > 0) { foreach (Subject_Info thisSubject in digitalObject.Bib_Info.Subjects) { // Add every subject to the complete list of subjects allsubjects.Add(thisSubject.ToString(false)); // Add name subjects if (thisSubject.Class_Type == Subject_Info_Type.Name) { namesubject.Add(thisSubject.ToString(false)); } // Add title subjects if (thisSubject.Class_Type == Subject_Info_Type.TitleInfo) { titlesubject.Add(thisSubject.ToString(false)); } // Add the subject keywords if ((thisSubject.Class_Type == Subject_Info_Type.Standard) && (thisSubject.ID.IndexOf("690") < 0) && (thisSubject.ID.IndexOf("691") < 0)) { // Cast to the hierarchical subject type Subject_Info_Standard standSubj = (Subject_Info_Standard)thisSubject; if (standSubj.Genres_Count > 0) { foreach (string genreTerm in standSubj.Genres) { genre.Add(genreTerm.ToLower()); } } if (standSubj.Geographics_Count > 0) { foreach (string geoTerm in standSubj.Geographics) { spatialcoverage.Add(geoTerm); } } if (standSubj.Topics_Count > 0) { foreach (string topicTerm in standSubj.Topics) { subjectkeyword.Add(topicTerm); } } } // Add hierarchical spatial info if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial) { // Cast to the hierarchical subject type Subject_Info_HierarchicalGeographic hiero = (Subject_Info_HierarchicalGeographic)thisSubject; // Check for existing subfacets and add if not there if ((hiero.Continent.Length > 0) && (!spatialcoverage.Contains(hiero.Continent))) { spatialcoverage.Add(hiero.Continent); } if ((hiero.Country.Length > 0) && (!country.Contains(hiero.Country))) { country.Add(hiero.Country); } if ((hiero.State.Length > 0) && (!state.Contains(hiero.State))) { state.Add(hiero.State); } if ((hiero.County.Length > 0) && (!county.Contains(hiero.County))) { county.Add(hiero.County); } if ((hiero.City.Length > 0) && (!city.Contains(hiero.City))) { city.Add(hiero.City); } if ((hiero.Island.Length > 0) && (!spatialcoverage.Contains(hiero.Island))) { spatialcoverage.Add(hiero.Island); } } } } // Add the individual genre information (just to be done with genre) if (digitalObject.Bib_Info.Genres_Count > 0) { foreach (Genre_Info thisGenre in digitalObject.Bib_Info.Genres) { genre.Add(thisGenre.Genre_Term.ToLower()); } } // Add all the temporal subjects if (digitalObject.Bib_Info.TemporalSubjects_Count > 0) { foreach (Temporal_Info thisTemporal in digitalObject.Bib_Info.TemporalSubjects) { if (thisTemporal.TimePeriod.Length > 0) { allsubjects.Add(thisTemporal.TimePeriod); temporalsubject.Add(thisTemporal.TimePeriod); } } } // Prepare to step through all the divisions/pages in this item int pageorder = 1; tocterms = new List <string>(); solrpages = new List <SolrPage>(); List <abstract_TreeNode> divsAndPages = digitalObject.Divisions.Physical_Tree.Divisions_PreOrder; // Get the list of all TXT files in this division string[] text_files = Directory.GetFiles(File_Location, "*.txt"); Dictionary <string, string> text_files_existing = new Dictionary <string, string>(); foreach (string thisTextFile in text_files) { string filename = (new FileInfo(thisTextFile)).Name.ToUpper(); text_files_existing[filename] = filename; } // Get the list of all THM.JPG files in this division string[] thumbnail_files = Directory.GetFiles(File_Location, "*thm.jpg"); Dictionary <string, string> thumbnail_files_existing = new Dictionary <string, string>(); foreach (string thisTextFile in thumbnail_files) { string filename = (new FileInfo(thisTextFile)).Name; thumbnail_files_existing[filename.ToUpper().Replace("THM.JPG", "")] = filename; } // Step through all division nodes from the physical tree here List <string> text_files_included = new List <string>(); foreach (abstract_TreeNode thisNode in divsAndPages) { if (thisNode.Page) { // Cast to a page to continnue Page_TreeNode pageNode = (Page_TreeNode)thisNode; // If this is a unique page label, add it if (pageNode.Label.Length > 0) { if (pageNode.Label.ToUpper().IndexOf("PAGE ") < 0) { tocterms.Add(pageNode.Label); } } // Look for the root filename and then look for a matching TEXT file if (pageNode.Files.Count > 0) { string root = pageNode.Files[0].File_Name_Sans_Extension; if (text_files_existing.ContainsKey(root.ToUpper() + ".TXT")) { try { // SInce this is marked to be included, save this name text_files_included.Add(root.ToUpper() + ".TXT"); // Read the page text StreamReader reader = new StreamReader(File_Location + "\\" + root + ".txt"); string pageText = reader.ReadToEnd().Trim(); reader.Close(); // Look for a matching thumbnail string thumbnail = String.Empty; if (thumbnail_files_existing.ContainsKey(root.ToUpper())) { thumbnail = thumbnail_files_existing[root.ToUpper()]; } SolrPage newPage = new SolrPage(digitalObject.BibID, digitalObject.VID, pageorder, pageNode.Label, pageText, thumbnail); solrpages.Add(newPage); } catch { } } } // Increment the page order for the next page irregardless pageorder++; } else { // Add the label or type for this division if (thisNode.Label.Length > 0) { tocterms.Add(thisNode.Label); } else if (thisNode.Type.Length > 0) { tocterms.Add(thisNode.Type); } } } // Now, check for any other valid text files additional_text_files = new List <string>(); foreach (string thisTextFile in text_files_existing.Keys) { if ((!text_files_included.Contains(thisTextFile.ToUpper())) && (thisTextFile.ToUpper() != "AGREEMENT.TXT") && (thisTextFile.ToUpper().IndexOf("REQUEST") != 0)) { additional_text_files.Add(thisTextFile); } } }
/// <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 (!dublinCore) { int hierarchical_index = -1; for (int i = 0; i < Bib.Bib_Info.Subjects.Count; i++) { if (Bib.Bib_Info.Subjects[i].Class_Type == Subject_Info_Type.Hierarchical_Spatial) { hierarchical_index++; if (hierarchical_index == base.index) { Subject_Info_HierarchicalGeographic hierSubject = (Subject_Info_HierarchicalGeographic)Bib.Bib_Info.Subjects[i]; base.thisBox.Text = hierSubject.Area; break; } } } } else { int spatial_index = -1; for (int i = 0; i < Bib.Bib_Info.Subjects.Count; i++) { if (Bib.Bib_Info.Subjects[i].Class_Type == Subject_Info_Type.Hierarchical_Spatial) { spatial_index++; if (spatial_index == base.index) { Subject_Info_HierarchicalGeographic hierSubject = (Subject_Info_HierarchicalGeographic)Bib.Bib_Info.Subjects[i]; base.thisBox.Text = hierSubject.Area; break; } } else if (Bib.Bib_Info.Subjects[i].Class_Type == Subject_Info_Type.Standard) { Subject_Info_Standard standSubject = (Subject_Info_Standard)Bib.Bib_Info.Subjects[i]; if ((standSubject.Genres_Count == 0) && (standSubject.Occupations_Count == 0) && (standSubject.Topics_Count == 0)) { spatial_index++; if (spatial_index == base.index) { // Compute the result StringBuilder builder = new StringBuilder(); if (standSubject.Geographics_Count > 0) { foreach (string thisGeographic in standSubject.Geographics) { if (builder.Length > 0) { builder.Append(" -- "); } builder.Append(thisGeographic.Trim()); } } if (standSubject.Temporals_Count > 0) { foreach (string thisTemporal in standSubject.Temporals ) { if (builder.Length > 0) { builder.Append(" -- "); } builder.Append(thisTemporal.Trim()); } } base.thisBox.Text = builder.ToString(); break; } } } } } }
/// <summary> Renders the HTML for this element </summary> /// <param name="Output"> Textwriter to write the HTML for this element </param> /// <param name="Bib"> Object to populate this element from </param> /// <param name="Skin_Code"> Code for the current skin </param> /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param> /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param> /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param> /// <param name="CurrentLanguage"> Current user-interface language </param> /// <param name="Translator"> Language support object which handles simple translational duties </param> /// <param name="Base_URL"> Base URL for the current request </param> /// <remarks> This element appends a popup form to the popup_form_builder</remarks> public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL) { // Check that an acronym exists if (Acronym.Length == 0) { const string defaultAcronym = "Enter spatial information about this material hierarchically. This can either be the source or the subject of the material."; switch (CurrentLanguage) { case Web_Language_Enum.English: Acronym = defaultAcronym; break; case Web_Language_Enum.Spanish: Acronym = defaultAcronym; break; case Web_Language_Enum.French: Acronym = defaultAcronym; break; default: Acronym = defaultAcronym; break; } } Output.WriteLine(" <!-- " + Title + " Form Element -->"); Output.WriteLine(" <tr align=\"left\">"); Output.WriteLine(" <td width=\"" + LEFT_MARGIN + "px\"> </td>"); if (Acronym.Length > 0) { Output.WriteLine(" <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>"); } else { Output.WriteLine(" <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>"); } Output.WriteLine(" <td>"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td>"); Output.Write(" <div id=\"" + html_element_name + "_div\">"); // Ensure there is at least one spatial subject bool found_spatial = false; if (Bib.Bib_Info.Subjects_Count > 0) { if (Bib.Bib_Info.Subjects.Any(thisSubject => thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial)) { found_spatial = true; } } if (!found_spatial) { Bib.Bib_Info.Add_Hierarchical_Geographic_Subject(); } int subject_index = 1; if (Bib.Bib_Info.Subjects_Count > 0) { foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects) { if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial) { Subject_Info_HierarchicalGeographic hieroSubject = (Subject_Info_HierarchicalGeographic)thisSubject; // Add this subject linke if (hieroSubject.hasData) { Output.Write("\n <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'form_spatial_term_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', 490, 550, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'form_spatial_term_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', 490, 550 );\"><div class=\"form_linkline form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\">" + hieroSubject + "</div></a>"); } else { Output.Write("\n <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'form_spatial_term_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', 490, 550, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'form_spatial_term_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', 490, 550 );\"><div class=\"form_linkline_empty form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\"><i>Empty Spatial Coverage</i></div></a>"); } // Add the popup form popup_form_builder.AppendLine("<!-- Hierarchical Spatial Form " + subject_index + " -->"); popup_form_builder.AppendLine("<div class=\"spatial_popup_div\" id=\"form_spatial_" + subject_index + "\" style=\"display:none;\">"); popup_form_builder.AppendLine(" <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT HIERARCHICAL SPATIAL</td><td align=\"right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_spatial_form('form_spatial_" + subject_index + "')\">X</a> </td></tr></table></div>"); popup_form_builder.AppendLine(" <br />"); popup_form_builder.AppendLine(" <table class=\"popup_table\">"); // Add the rows of data popup_form_builder.AppendLine(" <tr><td width=\"100px\">Continent:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialcontinent_" + subject_index + "\" id=\"formspatialcontinent_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Continent) + "\" onfocus=\"javascript:textbox_enter('formspatialcontinent_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialcontinent_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Country:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialcountry_" + subject_index + "\" id=\"formspatialcountry_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Country) + "\" onfocus=\"javascript:textbox_enter('formspatialcountry_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialcountry_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Province:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialprovince_" + subject_index + "\" id=\"formspatialprovince_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Province) + "\" onfocus=\"javascript:textbox_enter('formspatialprovince_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialprovince_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Region:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialregion_" + subject_index + "\" id=\"formspatialregion_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Region) + "\" onfocus=\"javascript:textbox_enter('formspatialregion_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialregion_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>State:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialstate_" + subject_index + "\" id=\"formspatialstate_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.State) + "\" onfocus=\"javascript:textbox_enter('formspatialstate_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialstate_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Territory:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialterritory_" + subject_index + "\" id=\"formspatialterritory_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Territory) + "\" onfocus=\"javascript:textbox_enter('formspatialterritory_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialterritory_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>County:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialcounty_" + subject_index + "\" id=\"formspatialcounty_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.County) + "\" onfocus=\"javascript:textbox_enter('formspatialcounty_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialcounty_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>City:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialcity_" + subject_index + "\" id=\"formspatialcity_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.City) + "\" onfocus=\"javascript:textbox_enter('formspatialcity_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialcity_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>City Section:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialsectioncity_" + subject_index + "\" id=\"formspatialsectioncity_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.CitySection) + "\" onfocus=\"javascript:textbox_enter('formspatialsectioncity_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialsectioncity_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Island:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialisland_" + subject_index + "\" id=\"formspatialisland_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Island) + "\" onfocus=\"javascript:textbox_enter('formspatialisland_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialisland_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); popup_form_builder.AppendLine(" <tr><td>Area:</td><td colspan=\"2\"><input class=\"formspatial_input\" name=\"formspatialarea_" + subject_index + "\" id=\"formspatialarea_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Area) + "\" onfocus=\"javascript:textbox_enter('formspatialarea_" + subject_index + "', 'formspatial_input_focused')\" onblur=\"javascript:textbox_leave('formspatialarea_" + subject_index + "', 'formspatial_input')\" /></td></tr>"); // Add the authority and language text boxes popup_form_builder.Append(" <tr><td>Authority:</td><td>"); popup_form_builder.Append("<input class=\"formspatial_small_input\" name=\"formspatialauthority_" + subject_index + "\" id=\"formspatialauthority_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Authority) + "\" onfocus=\"javascript:textbox_enter('formspatialauthority_" + subject_index + "', 'formspatial_small_input_focused')\" onblur=\"javascript:textbox_leave('formspatialauthority_" + subject_index + "', 'formspatial_small_input')\" />"); popup_form_builder.Append("</td><td width=\"255px\" > Language: "); popup_form_builder.Append("<input class=\"formspatial_small_input\" name=\"formspatiallanguage_" + subject_index + "\" id=\"formspatiallanguage_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Language) + "\" onfocus=\"javascript:textbox_enter('formspatiallanguage_" + subject_index + "', 'formspatial_small_input_focused')\" onblur=\"javascript:textbox_leave('formspatiallanguage_" + subject_index + "', 'formspatial_small_input')\" />"); popup_form_builder.AppendLine("</td></tr>"); popup_form_builder.AppendLine(" <tr height=\"30px\" valign=\"bottom\" ><td colspan=\"3\">"); popup_form_builder.AppendLine(" <center>"); if (hieroSubject.ID.IndexOf("SUBJ752") >= 0) { popup_form_builder.AppendLine(" <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_subj_" + subject_index + "\" value=\"subject\" /><label for=\"formspatialtype_subj_" + subject_index + "\">Hierarchical Subject</label> "); popup_form_builder.AppendLine(" <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_added_" + subject_index + "\" value=\"addedentry\" checked=\"checked\" /><label for=\"formspatialtype_added_" + subject_index + "\">Added Hierarchical Entry</label>"); } else { popup_form_builder.AppendLine(" <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_subj_" + subject_index + "\" value=\"subject\" checked=\"checked\" /><label for=\"formspatialtype_subj_" + subject_index + "\">Hierarchical Subject</label> "); popup_form_builder.AppendLine(" <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_added_" + subject_index + "\" value=\"addedentry\" /><label for=\"formspatialtype_added_" + subject_index + "\">Added Hierarchical Entry</label>"); } popup_form_builder.AppendLine(" </center>"); popup_form_builder.AppendLine(" </td></tr>"); popup_form_builder.AppendLine(" </table>"); popup_form_builder.AppendLine(" <br />"); popup_form_builder.AppendLine(" <center><a href=\"#template\" onclick=\"return close_spatial_form('form_spatial_" + subject_index + "');\"><img border=\"0\" src=\"" + Close_Button_URL(Skin_Code, Base_URL) + "\" alt=\"CLOSE\" /></a></center>"); popup_form_builder.AppendLine("</div>"); popup_form_builder.AppendLine(); subject_index++; } } } // Add the link to add a new other subject and close the main element Output.WriteLine("\n </div>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td valign=\"bottom\" >"); if (Repeatable) { Output.WriteLine(" <a title=\"" + Translator.Get_Translation("Click to add a new spatial coverage object", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return new_spatial_link_clicked('" + Template_Page + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>"); } Output.WriteLine(" <a target=\"_" + html_element_name.ToUpper() + "\" title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>"); Output.WriteLine(" </td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" </tr>"); Output.WriteLine(); }
/// <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); PALMM_Info palmmInfo = new PALMM_Info(); testPackage.Add_Metadata_Module("PALMM", palmmInfo); palmmInfo.toPALMM = false; // Save this package testPackage.Source_Directory = directory; return(testPackage); }
/// <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) { if (Original.Bib_Info.Subjects_Count > 0) { int spatial_count = 1; foreach (Subject_Info thisSubject in Original.Bib_Info.Subjects) { if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial) { // Determine the term to use string term = "Hierarchical Spatial"; if (spatial_count > 1) { term = term + " (" + spatial_count + ")"; } // Start to build this BriefItem_DescriptiveTerm thisTerm = new BriefItem_DescriptiveTerm(term); // Cast to the hierarchical geographic subject Subject_Info_HierarchicalGeographic hieroSubj = (Subject_Info_HierarchicalGeographic)thisSubject; // Now, step through and add each subterm if (!String.IsNullOrWhiteSpace(hieroSubj.Continent)) { thisTerm.Add_Value(hieroSubj.Continent, "Continent"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Country)) { thisTerm.Add_Value(hieroSubj.Country, "Country"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Province)) { thisTerm.Add_Value(hieroSubj.Province, "Province"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Region)) { thisTerm.Add_Value(hieroSubj.Region, "Region"); } if (!String.IsNullOrWhiteSpace(hieroSubj.State)) { thisTerm.Add_Value(hieroSubj.State, "State"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Territory)) { thisTerm.Add_Value(hieroSubj.Territory, "Territory"); } if (!String.IsNullOrWhiteSpace(hieroSubj.County)) { thisTerm.Add_Value(hieroSubj.County, "County"); } if (!String.IsNullOrWhiteSpace(hieroSubj.City)) { thisTerm.Add_Value(hieroSubj.City, "City"); } if (!String.IsNullOrWhiteSpace(hieroSubj.CitySection)) { thisTerm.Add_Value(hieroSubj.CitySection, "City Section"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Island)) { thisTerm.Add_Value(hieroSubj.Island, "Island"); } if (!String.IsNullOrWhiteSpace(hieroSubj.Area)) { thisTerm.Add_Value(hieroSubj.Area, "Area"); } // Were some values found? if ((thisTerm.Values != null) && (thisTerm.Values.Count > 0)) { New.Add_Description(thisTerm); spatial_count++; } } } } return(true); }