protected override void OnInit(EventArgs E)
        {
            // Ensure there is a base URL
            if (String.IsNullOrEmpty(UI_ApplicationCache_Gateway.Settings.Servers.System_Base_URL))
            {
                string base_url = Request.Url.AbsoluteUri.ToLower().Replace("sobekcm.aspx", "");
                if (base_url.IndexOf("?") > 0)
                {
                    base_url = base_url.Substring(0, base_url.IndexOf("?"));
                }
                if (base_url[base_url.Length - 1] != '/')
                {
                    base_url = base_url + "/";
                }
                UI_ApplicationCache_Gateway.Settings.Servers.System_Base_URL = base_url;
                UI_ApplicationCache_Gateway.Settings.Servers.Base_URL        = base_url;
            }

            // Initializee the Sobek file system abstraction
            SobekFileSystem.Initialize(UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network, UI_ApplicationCache_Gateway.Settings.Servers.Image_URL);

            // Ensure the microservices client has read the configuration file
            if (!SobekEngineClient.Config_Read_Attempted)
            {
#if DEBUG
                string base_url = Request.Url.AbsoluteUri.ToLower().Replace("sobekcm.aspx", "");
                if (base_url.IndexOf("localhost:") > 0)
                {
                    if (base_url.IndexOf("?") > 0)
                    {
                        base_url = base_url.Substring(0, base_url.IndexOf("?"));
                    }
                    UI_ApplicationCache_Gateway.Settings.Servers.System_Base_URL = base_url;
                    UI_ApplicationCache_Gateway.Settings.Servers.Base_URL        = base_url;
                }
#endif

                // Get the base URL
                string path = Server.MapPath("config/default/sobekcm_microservices.config");
                SobekEngineClient.Read_Config_File(path, UI_ApplicationCache_Gateway.Settings.Servers.System_Base_URL);
            }


            pageGlobals = new SobekCM_Page_Globals(IsPostBack, "SOBEKCM");

            base.OnInit(E);
        }
Example #2
0
        protected override void OnInit(EventArgs E)
        {
            pageGlobals = new SobekCM_Page_Globals(IsPostBack, "SOBEKCM");

            base.OnInit(E);
        }