コード例 #1
0
        /// <summary> Constructor for a new instance of the Oai_MainWriter class </summary>
        /// <param name="All_Items_Lookup"> Lookup object used to pull basic information about any item loaded into this library </param>
        /// <param name="Query_String"> URL Query string to parse for OAI-PMH verbs and other values </param>
        public Oai_MainWriter(NameValueCollection Query_String, Item_Lookup_Object All_Items_Lookup)
            : base(null, null, null, null, null, null, null, null)

        {
            // Build list of valid arguments
            validArgs = new List <string>
            {
                "from",
                "until",
                "metadataPrefix",
                "set",
                "resumptionToken",
                "identifier",
                "verb",
                "portal",
                "urlrelative"
            };

            // Load the list of OAI sets
            oaiSets     = SobekCM_Database.Get_OAI_Sets();
            queryString = Query_String;

            itemLookupObj = All_Items_Lookup;

            root = SobekCM_Library_Settings.Base_Data_Directory;
        }
コード例 #2
0
        /// <summary> Constructor for a new instance of the Oai_MainWriter class </summary>
        /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param>
        /// <param name="Query_String"> URL Query string to parse for OAI-PMH verbs and other values </param>
        public Oai_MainWriter(NameValueCollection Query_String, RequestCache RequestSpecificValues) : base(RequestSpecificValues)

        {
            // Build list of valid arguments
            validArgs = new List <string>
            {
                "from",
                "until",
                "metadataPrefix",
                "set",
                "resumptionToken",
                "identifier",
                "verb",
                "portal",
                "urlrelative"
            };

            // Load the list of OAI sets
            oaiSets     = SobekCM_Database.Get_OAI_Sets();
            queryString = Query_String;

            // Set the response type
            HttpContext.Current.Response.ContentType = "text/xml";

            // Determine some global settings
            if (UI_ApplicationCache_Gateway.Configuration.OAI_PMH != null)
            {
                config = UI_ApplicationCache_Gateway.Configuration.OAI_PMH;
                oai_resource_identifier_base = UI_ApplicationCache_Gateway.Configuration.OAI_PMH.Identifier_Base;
                oai_repository_name          = UI_ApplicationCache_Gateway.Configuration.OAI_PMH.Name;
                oai_repository_identifier    = UI_ApplicationCache_Gateway.Configuration.OAI_PMH.Identifier;
            }
            else
            {
                config = new OAI_PMH_Configuration();
                config.Set_Default();
                config.Enabled = true;
            }
            if (String.IsNullOrEmpty(oai_resource_identifier_base))
            {
                oai_resource_identifier_base = "oai:" + UI_ApplicationCache_Gateway.Settings.System.System_Abbreviation + ":";
            }
            if (String.IsNullOrEmpty(oai_repository_name))
            {
                oai_repository_name = UI_ApplicationCache_Gateway.Settings.System.System_Name;
            }
            if (String.IsNullOrEmpty(oai_repository_identifier))
            {
                oai_repository_identifier = UI_ApplicationCache_Gateway.Settings.System.System_Abbreviation;
            }

            // Get the list of metadata prefixes permissiable by the system
            metadataPrefixes = new List <string>();
            foreach (OAI_PMH_Metadata_Format thisConfig in config.Metadata_Prefixes)
            {
                metadataPrefixes.Add(thisConfig.Prefix);
            }
        }