Ejemplo n.º 1
0
 private void ReloadServicesFrameworkRoutes()
 {
     //registration of routes when the servers is operating is done as part of the cache
     //because the web request cahcing provider is the only inter-server communication channel
     //that is reliable
     ServicesRoutingManager.RegisterServiceRoutes();
 }
Ejemplo n.º 2
0
        private static string InitializeApp(HttpApplication app, ref bool initialized)
        {
            var request  = app.Request;
            var redirect = Null.NullString;

            Logger.Trace("Request " + request.Url.LocalPath);

            //Don't process some of the AppStart methods if we are installing
            if (!IsUpgradeOrInstallRequest(app.Request))
            {
                //Check whether the current App Version is the same as the DB Version
                redirect = CheckVersion(app);
                if (string.IsNullOrEmpty(redirect) && !InstallBlocker.Instance.IsInstallInProgress())
                {
                    Logger.Info("Application Initializing");

                    //Cache Mapped Directory(s)
                    CacheMappedDirectory();
                    //Set globals
                    Globals.IISAppName             = request.ServerVariables["APPL_MD_PATH"];
                    Globals.OperatingSystemVersion = Environment.OSVersion.Version;
                    Globals.NETFrameworkVersion    = GetNETFrameworkVersion();
                    Globals.DatabaseEngineVersion  = GetDatabaseEngineVersion();
                    //Try and Upgrade to Current Framewok
                    Upgrade.TryUpgradeNETFramework();
                    Upgrade.CheckFipsCompilanceAssemblies();

                    //Log Server information
                    ServerController.UpdateServerActivity(new ServerInfo());
                    //Start Scheduler
                    StartScheduler();
                    //Log Application Start
                    LogStart();
                    //Process any messages in the EventQueue for the Application_Start event
                    EventQueueController.ProcessMessages("Application_Start");

                    ServicesRoutingManager.RegisterServiceRoutes();

                    ModuleInjectionManager.RegisterInjectionFilters();

                    //Set Flag so we can determine the first Page Request after Application Start
                    app.Context.Items.Add("FirstRequest", true);

                    Logger.Info("Application Initialized");

                    initialized = true;
                }
            }
            else
            {
                //NET Framework version is neeed by Upgrade
                Globals.NETFrameworkVersion    = GetNETFrameworkVersion();
                Globals.IISAppName             = request.ServerVariables["APPL_MD_PATH"];
                Globals.OperatingSystemVersion = Environment.OSVersion.Version;
            }
            return(redirect);
        }
Ejemplo n.º 3
0
 private static void ClearCache(bool refreshServiceRoutes)
 {
     DataCache.RemoveCache(DataCache.PortalAliasCacheKey);
     CacheController.FlushPageIndexFromCache();
     if (refreshServiceRoutes)
     {
         ServicesRoutingManager.ReRegisterServiceRoutesWhileSiteIsRunning();
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds the portal alias.
        /// </summary>
        /// <param name="objPortalAliasInfo">The obj portal alias info.</param>
        /// <returns>Portal alias id.</returns>
        public int AddPortalAlias(PortalAliasInfo objPortalAliasInfo)
        {
            int Id          = DataProvider.Instance().AddPortalAlias(objPortalAliasInfo.PortalID, objPortalAliasInfo.HTTPAlias.ToLower().Trim('/'), UserController.GetCurrentUserInfo().UserID);
            var objEventLog = new EventLogController();

            objEventLog.AddLog(objPortalAliasInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.PORTALALIAS_CREATED);

            //clear portal alias cache
            DataCache.RemoveCache(DataCache.PortalAliasCacheKey);
            ServicesRoutingManager.ReRegisterServiceRoutesWhileSiteIsRunning();
            return(Id);
        }
Ejemplo n.º 5
0
        private static string InitializeApp(HttpApplication app)
        {
            DnnLog.MethodEntry();
            HttpRequest request  = app.Request;
            string      redirect = Null.NullString;

            DnnLog.Trace("Request " + request.Url.LocalPath);

            //Don't process some of the AppStart methods if we are installing
            if (!request.Url.LocalPath.ToLower().EndsWith("installwizard.aspx") &&
                !request.Url.LocalPath.ToLower().EndsWith("upgradewizard.aspx") &&
                !request.Url.LocalPath.ToLower().EndsWith("install.aspx"))
            {
                //Check whether the current App Version is the same as the DB Version
                redirect = CheckVersion(app);
                if (string.IsNullOrEmpty(redirect))
                {
                    DnnLog.Info("Application Initializing");

                    //Cache Mapped Directory(s)
                    CacheMappedDirectory();
                    //Set globals
                    Globals.IISAppName             = request.ServerVariables["APPL_MD_PATH"];
                    Globals.OperatingSystemVersion = Environment.OSVersion.Version;
                    Globals.NETFrameworkVersion    = GetNETFrameworkVersion();
                    Globals.DatabaseEngineVersion  = GetDatabaseEngineVersion();
                    //Try and Upgrade to Current Framewok
                    Upgrade.TryUpgradeNETFramework();

                    //Start Scheduler
                    StartScheduler();
                    //Log Application Start
                    LogStart();
                    //Process any messages in the EventQueue for the Application_Start event
                    EventQueueController.ProcessMessages("Application_Start");

                    ServicesRoutingManager.RegisterServiceRoutes();

                    //Set Flag so we can determine the first Page Request after Application Start
                    app.Context.Items.Add("FirstRequest", true);

                    //Log Server information
                    ServerController.UpdateServerActivity(new ServerInfo());
                    DnnLog.Info("Application Initialized");
                }
            }
            else
            {
                //NET Framework version is neeed by Upgrade
                Globals.NETFrameworkVersion = GetNETFrameworkVersion();
            }
            return(redirect);
        }
        private static void ClearCache(bool refreshServiceRoutes, int portalId = -1)
        {
            DataCache.RemoveCache(DataCache.PortalAliasCacheKey);
            CacheController.FlushPageIndexFromCache();

            if (portalId > Null.NullInteger)
            {
                DataCache.ClearTabsCache(portalId);
            }

            if (refreshServiceRoutes)
            {
                ServicesRoutingManager.ReRegisterServiceRoutesWhileSiteIsRunning();
            }
        }