本文整理汇总了C#中SobekCM_Item.Add_Metadata_Module方法的典型用法代码示例。如果您正苦于以下问题:C# SobekCM_Item.Add_Metadata_Module方法的具体用法?C# SobekCM_Item.Add_Metadata_Module怎么用?C# SobekCM_Item.Add_Metadata_Module使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM_Item
的用法示例。
在下文中一共展示了SobekCM_Item.Add_Metadata_Module方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read_dmdSec
/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
LearningObjectMetadata lomInfo = Return_Package.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;
if (lomInfo == null)
{
lomInfo = new LearningObjectMetadata();
Return_Package.Add_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo);
}
// Loop through reading each XML node
do
{
// If this is the end of this section, return
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
return true;
// get the right division information based on node type
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
string name = Input_XmlReader.Name.ToLower();
if (( lom_namespace.Length > 0 ) && ( name.IndexOf( lom_namespace ) == 0))
name = name.Substring(lom_namespace.Length);
switch (name)
{
case "general":
read_general(Input_XmlReader.ReadSubtree(), lomInfo);
break;
case "lifecycle":
read_lifecycle(Input_XmlReader.ReadSubtree(), lomInfo);
break;
case "technical":
read_technical(Input_XmlReader.ReadSubtree(), lomInfo);
break;
case "educational":
read_educational(Input_XmlReader.ReadSubtree(), lomInfo);
break;
case "classification":
read_classification(Input_XmlReader.ReadSubtree(), lomInfo);
break;
}
}
} while (Input_XmlReader.Read());
return true;
}
示例2: Read_dmdSec
/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Get the geo-spatial information if it exists or create a new one
GeoSpatial_Information geoInfo = Return_Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
if (geoInfo == null)
{
geoInfo = new GeoSpatial_Information();
Return_Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
}
return Read_Metadata_Section(Input_XmlReader, geoInfo, Options);
}
示例3: Read_dmdSec
/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
Map_Info mapInfo = Return_Package.Get_Metadata_Module(GlobalVar.SOBEKCM_MAPS_METADATA_MODULE_KEY) as Map_Info;
if (mapInfo == null)
{
mapInfo = new Map_Info();
Return_Package.Add_Metadata_Module(GlobalVar.SOBEKCM_MAPS_METADATA_MODULE_KEY, mapInfo);
}
// Try to get the attributes from here first
if (Input_XmlReader.MoveToAttribute("id"))
mapInfo.MapID = Input_XmlReader.Value;
// Step through each field
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == "map:ufdc_map"))
return true;
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
switch (Input_XmlReader.Name)
{
case "map:indexes":
read_map_indexes(Input_XmlReader, mapInfo);
break;
case "map:entities":
read_map_entities(Input_XmlReader, mapInfo);
break;
case "map:sheets":
read_map_sheets(Input_XmlReader, mapInfo);
break;
}
}
}
// Return false since this read all the way to the end of the steam
return false;
}
示例4: Read_amdSec
/// <summary> Reads the amdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_amdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
DAITSS_Info daitssInfo = Return_Package.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
if (daitssInfo == null)
{
daitssInfo = new DAITSS_Info();
Return_Package.Add_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY, daitssInfo);
}
// Loop through reading each XML node
do
{
// If this is the end of this section, return
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
return true;
// get the right division information based on node type
switch (Input_XmlReader.NodeType)
{
case XmlNodeType.Element:
if ((Input_XmlReader.Name.ToLower() == "daitss:agreement_info") && (Input_XmlReader.HasAttributes))
{
if (Input_XmlReader.MoveToAttribute("ACCOUNT"))
daitssInfo.Account = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("SUB_ACCOUNT"))
daitssInfo.SubAccount = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("PROJECT"))
daitssInfo.Project = Input_XmlReader.Value;
}
break;
}
} while (Input_XmlReader.Read());
// Return false since this read all the way to the end of the steam
return false;
}
示例5: Read_dmdSec
//.........这里部分代码省略.........
thisPublisher.Add_Place(String.Empty, Input_XmlReader.Value, String.Empty);
}
break;
case "iso3166":
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
thisPublisher.Add_Place(String.Empty, String.Empty, Input_XmlReader.Value);
}
break;
}
}
}
else
{
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
thisPublisher.Add_Place(Input_XmlReader.Value);
}
}
}
break;
}
}
}
break;
case "part:performingArts":
if (partInfo == null)
{
partInfo = new Performing_Arts_Info();
Return_Package.Add_Metadata_Module("PerformingArts", partInfo);
}
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == "part:performingArts"))
break;
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
switch (Input_XmlReader.Name)
{
case "part:Performer":
string occupation = String.Empty;
string lifespan = String.Empty;
string title = String.Empty;
string sex = String.Empty;
if (Input_XmlReader.MoveToAttribute("occupation"))
occupation = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("lifespan"))
lifespan = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("title"))
title = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("sex"))
sex = Input_XmlReader.Value;
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
Performer newPerformer = partInfo.Add_Performer(Input_XmlReader.Value);
newPerformer.Occupation = occupation;
newPerformer.Title = title;
newPerformer.Sex = sex;
newPerformer.LifeSpan = lifespan;
}
示例6: Read_Metadata
/// <summary> Reads metadata from an open stream and saves to the provided item/package </summary>
/// <param name="Input_Stream"> Open stream to read metadata from </param>
/// <param name="Return_Package"> Package into which to read the metadata </param>
/// <param name="Options"> Dictionary of any options which this metadata reader/writer may utilize </param>
/// <param name="Error_Message">[OUTPUT] Explanation of the error, if an error occurs during reading </param>
/// <returns>TRUE if successful, otherwise FALSE </returns>
/// <remarks>This reader accepts two option values. 'EAD_File_ReaderWriter:XSL_Location' gives the location of a XSL
/// file, which can be used to transform the description XML read from this EAD into HTML (or another format of XML).
/// 'EAD_File_ReaderWriter:Analyze_Description' indicates whether to analyze the description section of the EAD and
/// read it into the item. (Default is TRUE).</remarks>
public bool Read_Metadata(Stream Input_Stream, SobekCM_Item Return_Package, Dictionary<string, object> Options, out string Error_Message)
{
// Ensure this metadata module extension exists
EAD_Info eadInfo = Return_Package.Get_Metadata_Module(GlobalVar.EAD_METADATA_MODULE_KEY) as EAD_Info;
if (eadInfo == null)
{
eadInfo = new EAD_Info();
Return_Package.Add_Metadata_Module(GlobalVar.EAD_METADATA_MODULE_KEY, eadInfo);
}
// Set a couple defaults first
Return_Package.Bib_Info.SobekCM_Type = TypeOfResource_SobekCM_Enum.Archival;
Return_Package.Bib_Info.Type.Collection = true;
Error_Message = String.Empty;
// Check for some options
string XSL_Location = String.Empty;
bool Analyze_Description = true;
if (Options != null)
{
if (Options.ContainsKey("EAD_File_ReaderWriter:XSL_Location"))
{
XSL_Location = Options["EAD_File_ReaderWriter:XSL_Location"].ToString();
}
if (Options.ContainsKey("EAD_File_ReaderWriter:Analyze_Description"))
{
bool.TryParse(Options["EAD_File_ReaderWriter:Analyze_Description"].ToString(), out Analyze_Description);
}
}
// Use a string builder to seperate the description and container sections
StringBuilder description_builder = new StringBuilder(20000);
StringBuilder container_builder = new StringBuilder(20000);
// Read through with a simple stream reader first
StreamReader reader = new StreamReader(Input_Stream);
string line = reader.ReadLine();
bool in_container_list = false;
// Step through each line
while (line != null)
{
if (!in_container_list)
{
// Do not import the XML stylesheet portion
if ((line.IndexOf("xml-stylesheet") < 0) && (line.IndexOf("<!DOCTYPE ") < 0))
{
// Does the start a DSC section?
if ((line.IndexOf("<dsc ") >= 0) || (line.IndexOf("<dsc>") > 0))
{
in_container_list = true;
container_builder.AppendLine(line);
}
else
{
description_builder.AppendLine(line);
}
}
}
else
{
// Add this to the container builder
container_builder.AppendLine(line);
// Does this end the container list section?
if (line.IndexOf("</dsc>") >= 0)
in_container_list = false;
}
// Get the next line
line = reader.ReadLine();
}
// Close the reader
reader.Close();
// Just assign all the description section first
eadInfo.Full_Description = description_builder.ToString();
// Should the decrpition additionally be analyzed?
if (Analyze_Description)
{
// Try to read the XML
try
{
XmlTextReader reader2 = new XmlTextReader(description_builder.ToString());
// Initial doctype declaration sometimes throws an error for a missing EAD.dtd.
bool ead_start_found = false;
int error = 0;
//.........这里部分代码省略.........
示例7: Read_MarcXML_Info
/// <summary> Reads the MARC Core-compliant section of XML and stores the data in the provided digital resource </summary>
/// <param name="r"> XmlTextReader from which to read the marc data </param>
/// <param name="thisBibInfo">Bibliographic object into which most the values are read</param>
/// <param name="package"> Digital resource object to save the data to if this is reading the top-level bibDesc (OPTIONAL)</param>
/// <param name="Importing_Record"> Importing record flag is used to determine if special treatment should be applied to the 001 identifier. If this is reading MarcXML from a dmdSec, this is set to false </param>
/// <param name="Options"> Dictionary of any options which this metadata reader/writer may utilize </param>
public static void Read_MarcXML_Info(XmlReader r, Bibliographic_Info thisBibInfo, SobekCM_Item package, bool Importing_Record, Dictionary<string, object> Options )
{
// Create the MARC_XML_Reader to load everything into first
MARC_Record record = new MARC_Record();
// Read from the file
record.Read_MARC_Info(r);
// Handle optional mapping first for retaining the 856 as a related link
if ((Options != null) && (Options.ContainsKey("MarcXML_File_ReaderWriter.Retain_856_As_Related_Link")))
{
if (Options["MarcXML_File_ReaderWriter.Retain_856_As_Related_Link"].ToString().ToUpper() == "TRUE")
{
if ((record.Get_Data_Subfield(856, 'u').Length > 0) && (record.Get_Data_Subfield(856, 'y').Length > 0))
{
string url856 = record.Get_Data_Subfield(856, 'u');
string label856 = record.Get_Data_Subfield(856, 'y');
thisBibInfo.Location.Other_URL = url856;
thisBibInfo.Location.Other_URL_Note = label856;
}
}
}
// Now, load values into the bib package
// Load the date ( 260 |c )
thisBibInfo.Origin_Info.MARC_DateIssued = Remove_Trailing_Punctuation(record.Get_Data_Subfield(260, 'c'));
// Load the descriptions and notes about this item
Add_Descriptions(thisBibInfo, record);
// Look for the 786 with special identifiers to map back into the source notes
foreach (MARC_Field thisRecord in record[786])
{
if ((thisRecord.Indicators == "0 ") && (thisRecord.Subfield_Count == 1) && (thisRecord.has_Subfield('n')))
thisBibInfo.Add_Note(thisRecord.Subfields[0].Data, Note_Type_Enum.Source);
}
// Add the contents (505)
if (record.Get_Data_Subfield(505, 'a').Length > 2)
{
thisBibInfo.Add_TableOfContents(record.Get_Data_Subfield(505, 'a'));
}
// Get the scale information (034)
if (record.Get_Data_Subfield(034, 'b').Length > 2)
{
thisBibInfo.Add_Scale(record.Get_Data_Subfield(034, 'b'), "SUBJ034");
}
// Get the scale information (255)
if ((record.Get_Data_Subfield(255, 'a').Length > 2) || (record.Get_Data_Subfield(255, 'b').Length > 2) || (record.Get_Data_Subfield(255, 'c').Length > 2))
{
thisBibInfo.Add_Scale(record.Get_Data_Subfield(255, 'a'), record.Get_Data_Subfield(255, 'b'), record.Get_Data_Subfield(255, 'c'), "SUBJ255");
}
// Get the coordinate information (034)
if ((record.Get_Data_Subfield(034, 'd').Length > 0) && (record.Get_Data_Subfield(034, 'e').Length > 0) && (record.Get_Data_Subfield(034, 'f').Length > 0) && (record.Get_Data_Subfield(034, 'g').Length > 0))
{
// This is an extra metadata component
GeoSpatial_Information geoInfo = package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
if (geoInfo == null)
{
geoInfo = new GeoSpatial_Information();
package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
}
if (geoInfo.Polygon_Count == 0)
{
try
{
string d_field = record.Get_Data_Subfield(034, 'd').Replace("O", "0");
string e_field = record.Get_Data_Subfield(034, 'e').Replace("O", "0");
string f_field = record.Get_Data_Subfield(034, 'f').Replace("O", "0");
string g_field = record.Get_Data_Subfield(034, 'g').Replace("O", "0");
double d_value = 1;
double e_value = 1;
double f_value = 1;
double g_value = 1;
if (d_field.Contains("."))
{
if (d_field.Contains("W"))
{
d_value = -1*Convert.ToDouble(d_field.Replace("W", ""));
}
else
{
d_value = Convert.ToDouble(d_field.Replace("E", ""));
}
}
else
//.........这里部分代码省略.........
示例8: Read_amdSec
/// <summary> Reads the amdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_amdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
RightsMD_Info rightsInfo = Return_Package.Get_Metadata_Module(GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY) as RightsMD_Info;
if (rightsInfo == null)
{
rightsInfo = new RightsMD_Info();
Return_Package.Add_Metadata_Module("PalmmRightsMD", rightsInfo);
}
// Loop through reading each XML node
do
{
// If this is the end of this section, return
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
return true;
// get the right division information based on node type
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
string name = Input_XmlReader.Name.ToLower();
if (name.IndexOf("rightsmd:") == 0)
name = name.Substring(9);
switch (name)
{
case "versionstatement":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
rightsInfo.Version_Statement = Input_XmlReader.Value.Trim();
}
break;
case "copyrightstatement":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
rightsInfo.Copyright_Statement = Input_XmlReader.Value.Trim();
}
break;
case "accesscode":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
rightsInfo.Access_Code = RightsMD_Info.AccessCode_Enum.NOT_SPECIFIED;
switch (Input_XmlReader.Value.Trim().ToLower())
{
case "public":
rightsInfo.Access_Code = RightsMD_Info.AccessCode_Enum.Public;
break;
case "private":
rightsInfo.Access_Code = RightsMD_Info.AccessCode_Enum.Private;
break;
case "campus":
rightsInfo.Access_Code = RightsMD_Info.AccessCode_Enum.Campus;
break;
}
}
break;
case "embargoend":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
DateTime convertedDate;
if (DateTime.TryParse(Input_XmlReader.Value, out convertedDate))
{
rightsInfo.Embargo_End = convertedDate;
}
}
break;
}
}
} while (Input_XmlReader.Read());
return true;
}
示例9: Add_Data
//.........这里部分代码省略.........
case "location":
Package.Bib_Info.Origin_Info.Add_Place(Data);
return true;
case "locationdepicted":
Package.Bib_Info.Add_Spatial_Subject(Data);
return true;
case "monthseason":
Package.Bib_Info.Series_Part_Info.Month = Data;
return true;
case "monthscovered":
Package.Bib_Info.Series_Part_Info.Month = Data;
return true;
case "namesorganizations":
Package.Bib_Info.Add_Name_Subject().Full_Name = Data;
return true;
case "originaldate":
Package.Bib_Info.Origin_Info.Date_Issued = Data;
return true;
case "originalitemid":
Package.Bib_Info.Add_Identifier(Data, "Original ItemID");
return true;
case "originalmedium":
VRACore_Info vraCoreInfo2 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
if (vraCoreInfo2 == null)
{
vraCoreInfo2 = new VRACore_Info();
Package.Add_Metadata_Module("VRACore", vraCoreInfo2);
}
vraCoreInfo2.Add_Material(Data, "medium");
return true;
case "originalpublisher":
Package.Bib_Info.Add_Publisher(Data);
return true;
case "photographer":
Package.Bib_Info.Add_Named_Entity(Data, "Photographer").Name_Type = Name_Info_Type_Enum.Personal;
return true;
case "photographs":
Package.Bib_Info.Add_Named_Entity(Data, "Photograph Studio").Name_Type = Name_Info_Type_Enum.Corporate;
return true;
case "physicalcollection":
Package.Bib_Info.Location.Holding_Name = Data;
return true;
case "presentedatboardmeeting":
Package.Bib_Info.Origin_Info.Add_Date_Other(Data, "Presented at board meeting");
return true;
case "presenter":
Package.Bib_Info.Add_Named_Entity(Data, "Presenter").Name_Type = Name_Info_Type_Enum.Personal;
return true;
case "president":
Package.Bib_Info.Add_Named_Entity(Data, "President").Name_Type = Name_Info_Type_Enum.Personal;
return true;
示例10: Read_dmdSec
/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
Zoological_Taxonomy_Info taxonInfo = Return_Package.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
if (taxonInfo == null)
{
taxonInfo = new Zoological_Taxonomy_Info();
Return_Package.Add_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY, taxonInfo);
}
// Loop through reading each XML node
do
{
// If this is the end of this section, return
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
return true;
// get the right division information based on node type
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
string name = Input_XmlReader.Name.ToLower();
if (name.IndexOf("dwc:") == 0)
name = name.Substring(4);
switch (name)
{
case "scientificname":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Scientific_Name = Input_XmlReader.Value.Trim();
}
break;
case "higherclassification":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Higher_Classification = Input_XmlReader.Value.Trim();
}
break;
case "kingdom":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Kingdom = Input_XmlReader.Value;
}
break;
case "phylum":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Phylum = Input_XmlReader.Value;
}
break;
case "class":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Class = Input_XmlReader.Value;
}
break;
case "order":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Order = Input_XmlReader.Value;
}
break;
case "family":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Family = Input_XmlReader.Value;
}
break;
case "genus":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
taxonInfo.Genus = Input_XmlReader.Value;
}
break;
case "specificepithet":
Input_XmlReader.Read();
if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
{
//.........这里部分代码省略.........
示例11: read_mets_header
//.........这里部分代码省略.........
case "USF":
case "SF":
package.Bib_Info.Source.Statement = "University of South Florida";
break;
case "UNF":
case "NF":
package.Bib_Info.Source.Statement = "University of North Florida";
break;
case "UWF":
case "WF":
package.Bib_Info.Source.Statement = "University of West Florida";
break;
case "FIU":
case "FI":
package.Bib_Info.Source.Statement = "Florida International University";
break;
case "FGCU":
case "FG":
case "GC":
package.Bib_Info.Source.Statement = "Florida Gulf Coast University";
break;
case "FAMU":
case "AM":
package.Bib_Info.Source.Statement = "Florida Agricultural and Mechanical University";
break;
case "FAU":
package.Bib_Info.Source.Statement = "Florida Atlantic University";
break;
case "FCLA":
package.Bib_Info.Source.Statement = "Florida Center for Library Automation";
break;
}
}
else
{
string code = r.Value.Substring(0, r.Value.IndexOf(","));
string name = r.Value.Substring(r.Value.IndexOf(",") + 1);
package.Bib_Info.Source.Statement = name;
package.Bib_Info.Source.Code = code;
}
break;
case OTHER:
r.Read();
package.METS_Header.Creator_Software = r.Value;
break;
case INDIVIDUAL:
r.Read();
package.METS_Header.Creator_Individual = r.Value;
break;
}
break;
case "note":
switch (agent_type)
{
case ORGANIZATION:
r.Read();
package.METS_Header.Add_Creator_Org_Notes(r.Value);
if (r.Value.Trim().IndexOf("projects=") == 0)
{
PALMM_Info palmmInfo = package.Get_Metadata_Module("PALMM") as PALMM_Info;
if (palmmInfo == null)
{
palmmInfo = new PALMM_Info();
package.Add_Metadata_Module("PALMM", palmmInfo);
}
palmmInfo.PALMM_Project = r.Value.Trim().Replace("projects=", "");
}
if (r.Value.Trim().IndexOf("server=") == 0)
{
PALMM_Info palmmInfo2 = package.Get_Metadata_Module("PALMM") as PALMM_Info;
if (palmmInfo2 == null)
{
palmmInfo2 = new PALMM_Info();
package.Add_Metadata_Module("PALMM", palmmInfo2);
}
palmmInfo2.PALMM_Server = r.Value.Trim().Replace("server=", "");
}
break;
case INDIVIDUAL:
r.Read();
package.METS_Header.Add_Creator_Individual_Notes(r.Value);
break;
}
break;
}
}
}
}
示例12: Read_dmdSec
/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the
/// entire package </summary>
/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
/// <param name="Return_Package"> Package into which to read the metadata</param>
/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
/// <returns> TRUE if successful, otherwise FALSE</returns>
public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists
VRACore_Info vraInfo = Return_Package.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
if (vraInfo == null)
{
vraInfo = new VRACore_Info();
Return_Package.Add_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY, vraInfo);
}
// Loop through reading each XML node
do
{
// If this is the end of this section, return
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
return true;
// get the right division information based on node type
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
string name = Input_XmlReader.Name.ToLower();
if (name.IndexOf("vra:") == 0)
name = name.Substring(4);
switch (name)
{
case "culturalcontext":
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_Cultural_Context(Input_XmlReader.Value);
}
break;
case "inscription":
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_Inscription(Input_XmlReader.Value);
}
break;
case "material":
string type = String.Empty;
if (Input_XmlReader.HasAttributes)
{
if (Input_XmlReader.MoveToAttribute("type"))
type = Input_XmlReader.Value;
}
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_Material(Input_XmlReader.Value, type);
}
break;
case "measurements":
string units = String.Empty;
if (Input_XmlReader.HasAttributes)
{
if (Input_XmlReader.MoveToAttribute("unit"))
units = Input_XmlReader.Value;
}
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_Measurement(Input_XmlReader.Value, units);
}
break;
case "stateedition":
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_State_Edition(Input_XmlReader.Value);
}
break;
case "styleperiod":
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
{
if (Input_XmlReader.Value.Length > 0)
vraInfo.Add_Style_Period(Input_XmlReader.Value);
}
break;
case "technique":
Input_XmlReader.Read();
//.........这里部分代码省略.........
示例13: Read_Simple_Dublin_Core_Info
//.........这里部分代码省略.........
break;
case "dc:title":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
{
if (BibInfo.Main_Title.Title.Length == 0)
{
BibInfo.Main_Title.Title = R.Value.Trim();
}
else
{
BibInfo.Add_Other_Title(R.Value.Trim(), Title_Type_Enum.alternative);
}
}
break;
case "dc:type":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
{
BibInfo.Type.Add_Uncontrolled_Type(R.Value.Trim());
}
break;
case "thesis.degree.name":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && ( Return_Package != null ))
{
// Ensure the thesis object exists and is added
Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if (thesisInfo == null)
{
thesisInfo = new Thesis_Dissertation_Info();
Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
}
thesisInfo.Degree = R.Value.Trim();
}
break;
case "thesis.degree.level":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
{
// Ensure the thesis object exists and is added
Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if (thesisInfo == null)
{
thesisInfo = new Thesis_Dissertation_Info();
Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
}
string temp = R.Value.Trim().ToLower();
if ((temp == "doctorate") || (temp == "doctoral"))
thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
if ((temp == "masters") || (temp == "master's"))
thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
if ((temp == "bachelors") || (temp == "bachelor's"))
thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
if ((temp == "post-doctorate") || (temp == "post-doctoral"))
thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
}
break;
case "thesis.degree.discipline":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
{
// Ensure the thesis object exists and is added
Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if (thesisInfo == null)
{
thesisInfo = new Thesis_Dissertation_Info();
Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
}
thesisInfo.Add_Degree_Discipline(R.Value.Trim());
}
break;
case "thesis.degree.grantor":
R.Read();
if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
{
// Ensure the thesis object exists and is added
Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if (thesisInfo == null)
{
thesisInfo = new Thesis_Dissertation_Info();
Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
}
thesisInfo.Degree_Grantor = R.Value.Trim();
}
break;
}
}
}
}
示例14: read_coordinates_info
private void read_coordinates_info(XmlReader Input_XmlReader, SobekCM_Item Return_Package)
{
GeoSpatial_Information geoInfo = Return_Package.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
if (geoInfo == null)
{
geoInfo = new GeoSpatial_Information();
Return_Package.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
}
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == sobekcm_namespace + ":Coordinates"))
{
return;
}
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
switch (Input_XmlReader.Name.Replace(sobekcm_namespace + ":", ""))
{
case "KML":
if (!Input_XmlReader.IsEmptyElement)
{
Input_XmlReader.Read();
if (Input_XmlReader.NodeType == XmlNodeType.Text)
geoInfo.KML_Reference = Input_XmlReader.Value;
}
break;
case "Point":
geoInfo.Add_Point(read_point(Input_XmlReader));
break;
case "Line":
Coordinate_Line newLine = new Coordinate_Line();
if (Input_XmlReader.MoveToAttribute("label"))
newLine.Label = Input_XmlReader.Value;
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == sobekcm_namespace + ":Line"))
{
geoInfo.Add_Line(newLine);
break;
}
if ((Input_XmlReader.NodeType == XmlNodeType.Element) && (Input_XmlReader.Name == sobekcm_namespace + ":Point"))
{
newLine.Add_Point(read_point(Input_XmlReader));
}
}
break;
case "Polygon":
Coordinate_Polygon newPolygon = new Coordinate_Polygon();
if (Input_XmlReader.MoveToAttribute("label"))
newPolygon.Label = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("ID"))
newPolygon.ID = Input_XmlReader.Value;
if (Input_XmlReader.MoveToAttribute("pageSeq"))
{
try
{
newPolygon.Page_Sequence = Convert.ToUInt16(Input_XmlReader.Value);
}
catch
{
}
}
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == sobekcm_namespace + ":Polygon"))
{
geoInfo.Add_Polygon(newPolygon);
break;
}
if (Input_XmlReader.NodeType == XmlNodeType.Element)
{
if (Input_XmlReader.Name == sobekcm_namespace + ":Edge")
{
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == sobekcm_namespace + ":Edge"))
{
break;
}
if ((Input_XmlReader.NodeType == XmlNodeType.Element) && (Input_XmlReader.Name == sobekcm_namespace + ":Point"))
{
newPolygon.Add_Edge_Point(read_point(Input_XmlReader));
}
}
}
if (Input_XmlReader.Name == sobekcm_namespace + ":Internal")
{
while (Input_XmlReader.Read())
{
if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && (Input_XmlReader.Name == sobekcm_namespace + ":Internal"))
{
//.........这里部分代码省略.........
示例15: Read_Metadata
/// <summary> Reads metadata from an open stream and saves to the provided item/package </summary>
/// <param name="Input_Stream"> Open stream to read metadata from </param>
/// <param name="Return_Package"> Package into which to read the metadata </param>
/// <param name="Options"> Dictionary of any options which this metadata reader/writer may utilize </param>
/// <param name="Error_Message">[OUTPUT] Explanation of the error, if an error occurs during reading </param>
/// <returns>TRUE if successful, otherwise FALSE </returns>
/// <remarks> Accepts two options: (1) 'METS_File_ReaderWriter:Minimize_File_Info' which tells whether the reader
/// should just skip the file reading portion completely, and just read the bibliographic data ( Default is FALSE).
/// (2) 'METS_File_ReaderWriter:Support_Divisional_dmdSec_amdSec' </remarks>
public bool Read_Metadata(Stream Input_Stream, SobekCM_Item Return_Package, Dictionary<string, object> Options, out string Error_Message)
{
Error_Message = String.Empty;
// Read the options from the dictionary of options
bool minimizeFileInfo = false;
if (Options != null)
{
if (Options.ContainsKey("METS_File_ReaderWriter:Minimize_File_Info"))
bool.TryParse(Options["METS_File_ReaderWriter:Minimize_File_Info"].ToString(), out minimizeFileInfo);
if (Options.ContainsKey("METS_File_ReaderWriter:Support_Divisional_dmdSec_amdSec"))
{
bool supportDivisionalDmdSecAmdSec;
bool.TryParse(Options["METS_File_ReaderWriter:Support_Divisional_dmdSec_amdSec"].ToString(), out supportDivisionalDmdSecAmdSec);
}
}
// Keep a list of all the files created, by file id, as additional data is gathered
// from the different locations ( amdSec, fileSec, structmap )
Dictionary<string, SobekCM_File_Info> files_by_fileid = new Dictionary<string, SobekCM_File_Info>();
// For now, to do support for old way of doing downloads, build a list to hold
// the deprecated download files
List<Download_Info_DEPRECATED> deprecatedDownloads = new List<Download_Info_DEPRECATED>();
// Need to store the unanalyzed sections of dmdSec and amdSec until we determine if
// the scope is the whole package, or the top-level div. We use lists as the value since
// several sections may have NO id and the METS may even (incorrectly) have multiple sections
// with the same ID
Dictionary<string, List<Unanalyzed_METS_Section>> dmdSec = new Dictionary<string, List<Unanalyzed_METS_Section>>();
Dictionary<string, List<Unanalyzed_METS_Section>> amdSec = new Dictionary<string, List<Unanalyzed_METS_Section>>();
// Dictionaries store the link between dmdSec and amdSec id's to single divisions
Dictionary<string, abstract_TreeNode> division_dmdids = new Dictionary<string, abstract_TreeNode>();
Dictionary<string, abstract_TreeNode> division_amdids = new Dictionary<string, abstract_TreeNode>();
try
{
// Try to read the XML
XmlReader r = new XmlTextReader(Input_Stream);
// Begin stepping through each of the XML nodes
while (r.Read())
{
#region Handle some processing instructions requested by Florida SUS's / FLVC (hope to deprecate)
// Handle some processing instructions requested by Florida SUS's / FLVC
if (r.NodeType == XmlNodeType.ProcessingInstruction)
{
if (r.Name.ToLower() == "fcla")
{
string value = r.Value.ToLower();
if (value.IndexOf("fda=\"yes\"") >= 0)
{
DAITSS_Info daitssInfo = Return_Package.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
if (daitssInfo == null)
{
daitssInfo = new DAITSS_Info();
Return_Package.Add_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY, daitssInfo);
}
daitssInfo.toArchive = true;
}
if (value.IndexOf("fda=\"no\"") >= 0)
{
DAITSS_Info daitssInfo2 = Return_Package.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
if (daitssInfo2 == null)
{
daitssInfo2 = new DAITSS_Info();
Return_Package.Add_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY, daitssInfo2);
}
daitssInfo2.toArchive = false;
}
}
}
#endregion
if (r.NodeType == XmlNodeType.Element)
{
switch (r.Name.Replace("METS:", ""))
{
case "mets":
if (r.MoveToAttribute("OBJID"))
Return_Package.METS_Header.ObjectID = r.Value;
break;
case "metsHdr":
read_mets_header(r.ReadSubtree(), Return_Package);
break;
//.........这里部分代码省略.........