• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SobekCM_Item类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SobekCM_Item的典型用法代码示例。如果您正苦于以下问题:C# SobekCM_Item类的具体用法?C# SobekCM_Item怎么用?C# SobekCM_Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SobekCM_Item类属于命名空间,在下文中一共展示了SobekCM_Item类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:15,代码来源:PALMM_Info.cs


示例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;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:40,代码来源:MarcXML_File_ReaderWriter.cs


示例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;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:33,代码来源:MODS_File_ReaderWriter.cs


示例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;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:40,代码来源:DC_OAI_Metadata_Type_Writer.cs


示例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;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:32,代码来源:METS_File_ReaderWriter.cs


示例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;
 }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:GML_METS_dmdSec_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:RightsMD_METS_amdSec_ReaderWriter.cs


示例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();
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:14,代码来源:Coordinates_File_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:SobekCM_Map_METS_dmdSec_ReaderWriter.cs


示例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;
 }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:ETD_SobekCM_METS_dmdSec_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:LOM_IEEE_METS_dmdSec_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:DarwinCore_METS_dmdSec_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:DAITSS_METS_amdSec_ReaderWriter.cs


示例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;
 }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:11,代码来源:VRACore_METS_dmdSec_ReaderWriter.cs


示例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;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:62,代码来源:ETD_PALMM_METS_dmdSec_ReaderWriter.cs


示例16: 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;

            // Old MXF files will not have a VID, so assign 00001
            if (Return_Package.VID.Length == 0)
            {
                Return_Package.VID = "00001";
            }

            // Load this MXF File
            XmlDocument mxfXML = new XmlDocument();
            mxfXML.Load(MetadataFilePathName);

            // Set the source directory correctly
            Return_Package.Source_Directory = (new FileInfo(MetadataFilePathName)).DirectoryName;

            // create the node reader
            XmlNodeReader nodeReader = new XmlNodeReader(mxfXML);

            // Read through all the nodes until the package tag is found
            move_to_node(nodeReader, "package");

            // Get the package attribute
            process_package_tag(nodeReader, Return_Package);

            // Read through all the nodes until the packageDesc section is found
            move_to_node(nodeReader, "packageDesc");

            // Process all of the packageDesc sections
            process_packageDesc(nodeReader, Return_Package);

            // Read through to the beginning of the entity description
            move_to_node(nodeReader, "entityDesc");

            // Process the entire entity tag and the projects tag
            process_entity_tag_and_project(nodeReader, Return_Package);

            // Set the object id and some other METS values not in the MXF
            Return_Package.METS_Header.ObjectID = Return_Package.BibID + "_" + Return_Package.VID;

            // Move to the bibDesc
            move_to_node(nodeReader, "bibDesc");

            // Process the bib desc section
            process_bib_desc(nodeReader, Return_Package);

            // Will just use a text reader to step through all of the division information
            process_divisions(MetadataFilePathName, Return_Package);

            nodeReader.Close();

            return true;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:61,代码来源:MXF_File_ReaderWriter.cs


示例17: 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;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:59,代码来源:LOM_IEEE_METS_dmdSec_ReaderWriter.cs


示例18: 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);
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:18,代码来源:GML_METS_dmdSec_ReaderWriter.cs


示例19: 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)
        {
            // Determine if this is CSV or XML
            string extension = Path.GetExtension(MetadataFilePathName);
            if (( extension != null ) && (( extension.ToLower() == ".csv" ) || ( extension.ToLower() == ".txt" )))
            {
                // In this case, need to pass a new option to the stream writer, without altering the
                // original options
                Dictionary<string, object> newOptions = new Dictionary<string, object>();
                foreach (string thisKey in Options.Keys)
                {
                    if (thisKey != "Coordinates_File_ReaderWriter:CSV_Style")
                        newOptions[thisKey] = Options[thisKey];
                }
                newOptions["Coordinates_File_ReaderWriter:CSV_Style"] = true;

                try
                {
                    StreamWriter results = new StreamWriter(MetadataFilePathName, false, Encoding.UTF8);
                    bool returnValue = Write_Metadata(results, Item_To_Save, newOptions, out Error_Message);
                    results.Flush();
                    results.Close();

                    return returnValue;
                }
                catch (Exception ee)
                {
                    Error_Message = "Error writing GML Coordinates metadata to file '" + MetadataFilePathName + ": " + ee.Message;
                    return false;
                }
            }
            else
            {
                try
                {
                    StreamWriter results = new StreamWriter(MetadataFilePathName, false, Encoding.UTF8);
                    bool returnValue = Write_Metadata(results, Item_To_Save, Options, out Error_Message);
                    results.Flush();
                    results.Close();

                    return returnValue;
                }
                catch (Exception ee)
                {
                    Error_Message = "Error writing GML Coordinates metadata to file '" + MetadataFilePathName + ": " + ee.Message;
                    return false;
                }
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:55,代码来源:Coordinates_File_ReaderWriter.cs


示例20: Add_Data

        /// <summary> Adds a bit of data to a bibliographic package using the mapping </summary>
        /// <param name="Package">Bibliographic package to receive the data</param>
        /// <param name="Data">Text of the data</param>
        /// <param name="Field">Mapped field</param>
        /// <returns> TRUE if the field was mapped, FALSE if there was data and no mapping was found </returns>
        public static bool Add_Data(SobekCM_Item Package, string Data, string Field )
        {
            // Try to map using the mappers in order
            foreach (iBibliographicMapper mapper in mappers)
            {
                // Did this map this piece of data?
                if (mapper.Add_Data(Package, Data, Field))
                {
                    return true;
                }
            }

            // Apparently it was never mapped
            return false;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:20,代码来源:Bibliographic_Mapping.cs



注:本文中的SobekCM_Item类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Socket类代码示例发布时间:2022-05-24
下一篇:
C# Snippet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap