Esempio n. 1
0
        /// <summary> Sets the defautls for the metadata prefixes ( dublin core and marc21 ) </summary>
        public void Set_Default()
        {
            OAI_PMH_Metadata_Format dcFormat = new OAI_PMH_Metadata_Format
            {
                Class             = "DC_OAI_Metadata_Type_Writer",
                Enabled           = true,
                MetadataNamespace = "http://www.openarchives.org/OAI/2.0/oai_dc/",
                Namespace         = "SobekCM.Resource_Object.OAI.Writer",
                Prefix            = "oai_dc",
                Schema            = "http://www.openarchives.org/OAI/2.0/oai_dc.xsd"
            };

            Metadata_Prefixes.Add(dcFormat);

            OAI_PMH_Metadata_Format marcFormat = new OAI_PMH_Metadata_Format
            {
                Class             = "MarcXML_OAI_PMH_Metadata_Type_Writer",
                Enabled           = true,
                MetadataNamespace = "http://www.loc.gov/MARC21/slim",
                Namespace         = "SobekCM.Resource_Object.OAI.Writer",
                Prefix            = "marc21",
                Schema            = "http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
            };

            Metadata_Prefixes.Add(marcFormat);
        }
Esempio n. 2
0
        /// <summary> Add a new metadata prefix </summary>
        /// <param name="NewPrefix"> New OAI-PMH metadata prefix and reader/writer </param>
        public void Add_Metadata_Prefix(OAI_PMH_Metadata_Format NewPrefix)
        {
            // If there is an existing bit of information for the same prefix, remove it first
            OAI_PMH_Metadata_Format existing = null;

            foreach (OAI_PMH_Metadata_Format existingFormat in Metadata_Prefixes)
            {
                if (String.Compare(NewPrefix.Prefix, existingFormat.Prefix, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    existing = existingFormat;
                }
            }
            if (existing != null)
            {
                Metadata_Prefixes.Remove(existing);
            }

            // Add the new one
            Metadata_Prefixes.Add(NewPrefix);
        }