本文整理汇总了C#中SobekCM_Item类的典型用法代码示例。如果您正苦于以下问题:C# SobekCM_Item类的具体用法?C# SobekCM_Item怎么用?C# SobekCM_Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SobekCM_Item类属于命名空间,在下文中一共展示了SobekCM_Item类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Retrieve_Additional_Info_From_Database
/// <summary> Chance for this metadata module to load any additional data from the
/// database when building this digital resource in memory </summary>
/// <param name="ItemID"> Primary key for this item within the SobekCM database </param>
/// <param name="DB_ConnectionString">Connection string for the current database</param>
/// <param name="BibObject"> Entire resource, in case there are dependencies between this module and somethingt in the full resource </param>
/// <param name="Error_Message"> In the case of an error, this contains text of the error </param>
/// <returns> TRUE if no error occurred, otherwise FALSE </returns>
/// <remarks> This module currently does no additional processing in this method </remarks>
public bool Retrieve_Additional_Info_From_Database(int ItemID, string DB_ConnectionString, SobekCM_Item BibObject, out string Error_Message)
{
// Set the default error mesasge
Error_Message = String.Empty;
return true;
}
示例2: Read_Metadata
/// <summary> Reads metadata from an existing metadata file and saves to the provided item/package </summary>
/// <param name="MetadataFilePathName"> Path and name of the metadata file to read </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>
public bool Read_Metadata(string MetadataFilePathName, SobekCM_Item Return_Package, Dictionary<string, object> Options, out string Error_Message)
{
// Set default error outpt message
Error_Message = String.Empty;
// Create a stream and XML reader and read the metadata
Stream reader = null;
XmlTextReader nodeReader = null;
bool returnValue = true;
try
{
reader = new FileStream(MetadataFilePathName, FileMode.Open, FileAccess.Read);
// create the node reader
nodeReader = new XmlTextReader(reader);
MarcXML_METS_dmdSec_ReaderWriter.Read_MarcXML_Info(nodeReader, Return_Package.Bib_Info, Return_Package, true, Options );
}
catch (Exception ee)
{
Error_Message = "Error reading MarcXML from stream: " + ee.Message;
returnValue = false;
}
finally
{
if (nodeReader != null)
nodeReader.Close();
if (reader != null)
reader.Close();
}
return returnValue;
}
示例3: 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>
public bool Read_Metadata(Stream Input_Stream, SobekCM_Item Return_Package, Dictionary<string, object> Options, out string Error_Message)
{
// Set default error outpt message
Error_Message = String.Empty;
// Create a XML reader and read the metadata
XmlTextReader nodeReader = null;
bool returnValue = true;
try
{
// create the node reader
nodeReader = new XmlTextReader(Input_Stream);
MODS_METS_dmdSec_ReaderWriter.Read_MODS_Info(nodeReader, Return_Package.Bib_Info, Return_Package);
}
catch (Exception ee)
{
Error_Message = "Error reading MODS from stream: " + ee.Message;
returnValue = false;
}
finally
{
if (nodeReader != null)
nodeReader.Close();
}
return returnValue;
}
示例4: Create_OAI_PMH_Metadata
/// <summary> Returns the OAI-PMH metadata in dublin core (OAI-flavored) for this item </summary>
/// <param name="Item_To_Save"> Package with all the metadata to save </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 write </param>
/// <returns> Metadata for a OAI-PMH record of a particular metadata format/type </returns>
public override string Create_OAI_PMH_Metadata( SobekCM_Item Item_To_Save, Dictionary<string, object> Options, out string Error_Message)
{
// Set default error outpt message
Error_Message = String.Empty;
StringBuilder results = new StringBuilder();
StringWriter writer = new StringWriter(results);
writer.WriteLine("<oai_dc:dc xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" ");
writer.WriteLine("xmlns:dc=\"http://purl.org/dc/elements/1.1/\" ");
writer.WriteLine("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
writer.WriteLine("xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ ");
writer.WriteLine("http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">");
// Add the dublin core
DC_METS_dmdSec_ReaderWriter.Write_Simple_Dublin_Core(writer, Item_To_Save.Bib_Info);
// Add the URL as the identifier
if (Item_To_Save.Bib_Info.Location.PURL.Length > 0)
{
writer.WriteLine("<dc:identifier>" + Item_To_Save.Bib_Info.Location.PURL + "</dc:identifier>");
}
else if (Item_To_Save.Web.Service_URL.Length > 0)
{
writer.WriteLine("<dc:identifier>" + Item_To_Save.Web.Service_URL + "</dc:identifier>");
}
// Finish this OAI
writer.WriteLine("</oai_dc:dc>");
string resultsString = results.ToString();
writer.Close();
return resultsString;
}
示例5: Write_Metadata
/// <summary> Writes the formatted metadata from the provided item to a file </summary>
/// <param name="MetadataFilePathName"> Path and name of the metadata file to write</param>
/// <param name="Item_To_Save"> Package with all the metadata to save </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 write </param>
/// <returns>TRUE if successful, otherwise FALSE </returns>
public bool Write_Metadata(string MetadataFilePathName, SobekCM_Item Item_To_Save, Dictionary<string, object> Options, out string Error_Message)
{
StreamWriter results = null;
bool returnValue;
try
{
results = new StreamWriter(MetadataFilePathName, false, Encoding.UTF8);
returnValue = Write_Metadata(results, Item_To_Save, Options, out Error_Message);
}
catch (Exception ee)
{
Error_Message = "Error writing METS metadata to file '" + MetadataFilePathName + ": " + ee.Message;
returnValue = false;
}
finally
{
if (results != null)
{
results.Flush();
results.Close();
}
}
return returnValue;
}
示例6: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// GEt the geo-spatial information if it exists
GeoSpatial_Information geoInfo = METS_Item.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
if ((geoInfo == null) || (!geoInfo.hasData))
return false;
return true;
}
示例7: Include_amdSec
/// <summary> Flag indicates if this active reader/writer will write an amdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_amdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
RightsMD_Info rightsInfo = METS_Item.Get_Metadata_Module( GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY) as RightsMD_Info;
if ((rightsInfo == null) || (!rightsInfo.hasData))
return false;
return true;
}
示例8: Read_Metadata
/// <summary> Reads metadata from an existing metadata file and saves to the provided item/package </summary>
/// <param name="MetadataFilePathName"> Path and name of the metadata file to read </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>
public bool Read_Metadata(string MetadataFilePathName, SobekCM_Item Return_Package, Dictionary<string, object> Options, out string Error_Message)
{
Stream reader = new FileStream(MetadataFilePathName, FileMode.Open, FileAccess.Read);
Read_Metadata(reader, Return_Package, Options, out Error_Message);
reader.Close();
throw new NotImplementedException();
}
示例9: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
Map_Info mapInfo = METS_Item.Get_Metadata_Module(GlobalVar.SOBEKCM_MAPS_METADATA_MODULE_KEY) as Map_Info;
if ((mapInfo == null) || (!mapInfo.hasData))
return false;
return true;
}
示例10: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if ((thesisInfo == null) || (!thesisInfo.hasData))
return false;
return true;
}
示例11: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
LearningObjectMetadata lomInfo = METS_Item.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;
if ((lomInfo == null) || (!lomInfo.hasData))
return false;
return true;
}
示例12: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
Zoological_Taxonomy_Info taxonInfo = METS_Item.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
if ((taxonInfo == null) || (!taxonInfo.hasData))
return false;
return true;
}
示例13: Include_amdSec
/// <summary> Flag indicates if this active reader/writer will write an amdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_amdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
DAITSS_Info daitssInfo = METS_Item.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
if ((daitssInfo == null) || (!daitssInfo.hasData))
return false;
return true;
}
示例14: Include_dmdSec
/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
/// <param name="METS_Item"> Package with all the metadata to save</param>
/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
VRACore_Info vraInfo = METS_Item.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
if ((vraInfo == null) || (!vraInfo.hasData))
return false;
return true;
}
示例15: Write_dmdSec
/// <summary> Writes the dmdSec for the entire package to the text writer </summary>
/// <param name="Output_Stream">Stream to which the formatted text is written </param>
/// <param name="METS_Item">Package with all the metadata to save</param>
/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
/// <returns>TRUE if successful, otherwise FALSE </returns>
public override bool Write_dmdSec(TextWriter Output_Stream, SobekCM_Item METS_Item, Dictionary<string, object> Options)
{
// Ensure this metadata module extension exists and has data
Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
if ((thesisInfo == null) || (!thesisInfo.hasData))
return true;
Output_Stream.WriteLine("<palmm:thesis>");
if (!String.IsNullOrEmpty(thesisInfo.Committee_Chair))
Output_Stream.WriteLine("<palmm:committeeChair>" + Convert_String_To_XML_Safe(thesisInfo.Committee_Chair) + "</palmm:committeeChair>");
if (!String.IsNullOrEmpty(thesisInfo.Committee_Co_Chair))
Output_Stream.WriteLine("<palmm:committeeCoChair>" + Convert_String_To_XML_Safe(thesisInfo.Committee_Co_Chair) + "</palmm:committeeCoChair>");
if (thesisInfo.Committee_Members_Count > 0)
{
foreach (string thisCommitteeMember in thesisInfo.Committee_Members)
{
Output_Stream.WriteLine("<palmm:committeeMember>" + Convert_String_To_XML_Safe(thisCommitteeMember) + "</palmm:committeeMember>");
}
}
if (thesisInfo.Graduation_Date.HasValue)
{
string encoded_date = thesisInfo.Graduation_Date.Value.Year + "-" + thesisInfo.Graduation_Date.Value.Month.ToString().PadLeft(2, '0') + "-" + thesisInfo.Graduation_Date.Value.Day.ToString().PadLeft(2, '0');
Output_Stream.WriteLine("<palmm:graduationDate>" + encoded_date + "</palmm:graduationDate>");
}
if (!String.IsNullOrEmpty(thesisInfo.Degree))
Output_Stream.WriteLine("<palmm:degree>" + Convert_String_To_XML_Safe(thesisInfo.Degree) + "</palmm:degree>");
if (thesisInfo.Degree_Disciplines_Count > 0)
{
if ( thesisInfo.Degree_Disciplines_Count == 1 )
Output_Stream.WriteLine("<palmm:degreeDiscipline>" + Convert_String_To_XML_Safe(thesisInfo.Degree_Disciplines[0]) + "</palmm:degreeDiscipline>");
else
{
Output_Stream.Write("<palmm:degreeDiscipline>");
bool first = true;
foreach (string thisDiscipline in thesisInfo.Degree_Disciplines)
{
if ( !first )
Output_Stream.Write(";");
else
first = false;
Output_Stream.Write( Convert_String_To_XML_Safe(thisDiscipline));
}
Output_Stream.WriteLine("</palmm:degreeDiscipline>");
}
}
if (!String.IsNullOrEmpty(thesisInfo.Degree_Grantor))
Output_Stream.WriteLine("<palmm:degreeGrantor>" + Convert_String_To_XML_Safe(thesisInfo.Degree_Grantor) + "</palmm:degreeGrantor>");
if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors)
Output_Stream.WriteLine("<palmm:degreeLevel>Bachelors</palmm:degreeLevel>");
if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters)
Output_Stream.WriteLine("<palmm:degreeLevel>Masters</palmm:degreeLevel>");
if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate)
Output_Stream.WriteLine("<palmm:degreeLevel>Doctorate</palmm:degreeLevel>");
Output_Stream.WriteLine("</palmm:thesis>");
return true;
}