コード例 #1
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            try {
                Application["ApplicationStartError"] = null;
                Application["EspaceName"]            = "ContactManager";

                // Workaround: Force first access to HeContext to correctly save CurrentCulture
                var firstAccess = HeContext.UnknownEntryPoint;

                // Set default date/time format
                FormatInfo.SetDefaultDateAndDateTimeFormatString("yyyy-M-d", "yyyy-MM-dd");
                // Set decimal and group separator
                FormatInfo.SetInputDecimalSeparator(".");
                FormatInfo.SetInputGroupSeparator("");

                ESpaceInfoForAppStart eSpaceInfo = new ESpaceInfoForAppStart();

                // Check the eSpaceName from the begining of the path
                eSpaceInfo.ESpaceName              = (string)Application["EspaceName"];
                eSpaceInfo.ESpaceId                = eSpaceId;
                eSpaceInfo.ESpaceKey               = eSpaceKey;
                eSpaceInfo.IsMultiTenant           = false;
                eSpaceInfo.IsMobileRuntime         = false;
                eSpaceInfo.CacheInvalidationSuffix = (AppUtils.Instance.CacheInvalidationSuffix ?? String.Empty).RemoveIfStartsWith("?");

                // User Provider
                eSpaceInfo.UserProviderName = "";
                eSpaceInfo.UserProviderKey  = ObjectKey.Parse("");

                // Module Version
                eSpaceInfo.ESpaceVersionId     = RuntimePlatformSettings.Module.VersionId.GetValue();
                eSpaceInfo.ESpaceJQueryVersion = JQueryVersion.JQuery142;
                eSpaceInfo.GetStaticEntities   = () => GetStaticEntities(new HashSet <GlobalObjectKey>(), new HashSet <ObjectKey>());

                // Catalog
                var catalogName = RuntimePlatformSettings.Catalog.ForModule(ObjectKeyUtils.DatabaseValue(eSpaceKey)).Catalog.GetValue();
                eSpaceInfo.CatalogName = catalogName;
                eSpaceInfo.DataBaseConfigurationDetails = RuntimePlatformSettings.Catalog.Configuration(catalogName).All;


                AppInfo App = new AppInfo(eSpaceInfo);
                if (!forTestAction)
                {
                    App.SetupInvalidateCallbackCache();
                }
                OutSystems.HubEdition.WebWidgets.OSPage.ValidationMessagesInstance        = new ValidationMessages();
                OutSystems.HubEdition.WebWidgets.OSUserControl.ValidationMessagesInstance = new ValidationMessages();
                System.Net.ServicePointManager.Expect100Continue = RuntimePlatformSettings.Misc.RuntimeExpect100Continue.GetValue();

                LifecyleListenerManager.RegisterListener("OutSystems.RESTService.ServiceConfiguration", new System.Reflection.AssemblyName("OutSystems.RESTService.Runtime"));

                LifecyleListenerManager.OnApplicationStart();
            } catch (Exception excep) {
                Application["ApplicationStartError"] = excep;
                AppInfo.SetAppInfo(HttpContext.Current, null);
                ErrorLog.LogApplicationError(excep, /*context*/ null, "Global");
            }
        }
コード例 #2
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            try {
                Application["ApplicationStartError"] = null;
                Application["EspaceName"]            = "Address_CS";

                // Workaround: Force first access to HeContext to correctly save CurrentCulture
                var firstAccess = HeContext.UnknownEntryPoint;

                // Set default date/time format
                FormatInfo.SetDefaultDateAndDateTimeFormatString("yyyy-M-d", "yyyy-MM-dd");
                // Set decimal and group separator
                FormatInfo.SetInputDecimalSeparator(".");
                FormatInfo.SetInputGroupSeparator("");

                SMSInterface.Init();
                ESpaceInfoForAppStart eSpaceInfo = new ESpaceInfoForAppStart();

                // Check the eSpaceName from the begining of the path
                eSpaceInfo.ESpaceName          = "Address_CS";
                eSpaceInfo.ESpaceId            = eSpaceId;
                eSpaceInfo.ESpaceVersionId     = int.Parse(ConfigurationManager.AppSettings["OutSystems.HubEdition.EspaceVersionID"]);
                eSpaceInfo.ESpaceJQueryVersion = JQueryVersion.JQuery183;

                AppInfo App = new AppInfo(eSpaceInfo);
                if (!forTestAction)
                {
                    App.SetupInvalidateCallbackCache();
                    App.InjectionCache.RunCallbacks(App, null, OutSystems.HubEdition.RuntimePlatform.Callbacks.CallbackEvent.ApplicationStart);
                }
                OutSystems.HubEdition.WebWidgets.OSPage.ValidationMessagesInstance        = new ValidationMessages();
                OutSystems.HubEdition.WebWidgets.OSUserControl.ValidationMessagesInstance = new ValidationMessages();
                System.Net.ServicePointManager.Expect100Continue = Settings.GetBool(Settings.Configs.Runtime_Expect100Continue);

                LifecyleListenerManager.RegisterListener("OutSystems.RESTService.ServiceConfiguration", new System.Reflection.AssemblyName("OutSystems.RESTService.Runtime"));

                LifecyleListenerManager.OnApplicationStart();
            } catch (Exception excep) {
                Application["ApplicationStartError"] = excep;
                AppInfo.SetAppInfo(HttpContext.Current, null);
                ErrorLog.LogApplicationError(excep, /*context*/ null, "Global");
            }
        }