Пример #1
0
 /// <summary>
 /// At the end of a request, we'll check if there is a flag in the request indicating to rebuild the routes
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <remarks>
 /// In some cases many articulate roots might be published at one time but we only want to rebuild the routes once so we'll do it once
 /// at the end of the request.
 /// </remarks>
 private static void UmbracoApplication_PostRequestHandlerExecute(object sender, EventArgs e)
 {
     if (ApplicationContext.Current == null)
     {
         return;
     }
     if (ApplicationContext.Current.ApplicationCache.RequestCache.GetCacheItem("articulate-refresh-routes") == null)
     {
         return;
     }
     //the token was found so that means one or more articulate root nodes were changed in this request, rebuild the routes.
     ArticulateRoutes.MapRoutes(RouteTable.Routes, UmbracoContext.Current.ContentCache, UmbracoContext.Current.UrlProvider);
 }
Пример #2
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            //TODO: Listen to events when we need to re-map the routes when data changes!

            //map routes
            ArticulateRoutes.MapRoutes(RouteTable.Routes, UmbracoContext.Current.ContentCache);

            ContentService.Created               += ContentService_Created;
            ContentService.Saving                += ContentService_Saving;
            ContentService.Saved                 += ContentService_Saved;
            ServerVariablesParser.Parsing        += ServerVariablesParser_Parsing;
            ContentTypeService.SavingContentType += ContentTypeService_SavingContentType;
        }
Пример #3
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            //list to the init event of the application base, this allows us to bind to the actual HttpApplication events
            UmbracoApplicationBase.ApplicationInit += UmbracoApplicationBase_ApplicationInit;

            //map routes
            ArticulateRoutes.MapRoutes(RouteTable.Routes, UmbracoContext.Current.ContentCache);

            //umbraco event subscriptions
            ContentService.Created               += ContentService_Created;
            ContentService.Saving                += ContentService_Saving;
            ContentService.Saved                 += ContentService_Saved;
            ServerVariablesParser.Parsing        += ServerVariablesParser_Parsing;
            ContentTypeService.SavingContentType += ContentTypeService_SavingContentType;
            PageCacheRefresher.CacheUpdated      += PageCacheRefresher_CacheUpdated;
        }
Пример #4
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            //list to the init event of the application base, this allows us to bind to the actual HttpApplication events
            UmbracoApplicationBase.ApplicationInit += UmbracoApplicationBase_ApplicationInit;

            //map routes
            RouteTable.Routes.MapRoute(
                "ArticulateFeeds",
                "ArticulateFeeds/{action}/{id}",
                new { controller = "Feed", action = "RenderGitHubFeed", id = 0 }
                );
            ArticulateRoutes.MapRoutes(RouteTable.Routes, UmbracoContext.Current.ContentCache, UmbracoContext.Current.UrlProvider);

            //umbraco event subscriptions
            ContentService.Created               += ContentService_Created;
            ContentService.Saving                += ContentService_Saving;
            ContentService.Saved                 += ContentService_Saved;
            ServerVariablesParser.Parsing        += ServerVariablesParser_Parsing;
            ContentTypeService.SavingContentType += ContentTypeService_SavingContentType;
            PageCacheRefresher.CacheUpdated      += PageCacheRefresher_CacheUpdated;
            DomainCacheRefresher.CacheUpdated    += DomainCacheRefresher_CacheUpdated;
        }