public void OnApplicationStarted(UmbracoApplication httpApplication, ApplicationContext applicationContext)
        {
            var itemDocumentTypes = ConfigurationManager.AppSettings["AutoDocuments:ItemDocumentTypes"];
            var dateDocumentType = ConfigurationManager.AppSettings["AutoDocuments:DateDocumentType"];
            var itemDatePropertyAlias = ConfigurationManager.AppSettings["AutoDocuments:ItemDatePropertyAlias"];

            List<string> itemDocTypes = null;
            bool createDayDocuments = false;

            if (!string.IsNullOrEmpty(itemDocumentTypes))
                itemDocTypes = itemDocumentTypes.Split(',').ToList();

            string createDayDocumentsSetting = ConfigurationManager.AppSettings["AutoDocuments:CreateDayDocuments"];

            if (!string.IsNullOrEmpty(createDayDocumentsSetting))
                bool.TryParse(createDayDocumentsSetting, out createDayDocuments);

            if (itemDocTypes == null || itemDocTypes.Count == 0 || string.IsNullOrEmpty(dateDocumentType) || string.IsNullOrEmpty(itemDatePropertyAlias))
            {
                Log.Add(LogTypes.Debug, 0, string.Format("Auto Documents configuration invalid, ItemDocumentTypes:{0} DateDocumentType:{1} ItemDatePropertyAlias:{2}", itemDocumentTypes, dateDocumentType, itemDatePropertyAlias));
                return;
            }

            _autoDocuments = new AutoDocuments(itemDocTypes, itemDatePropertyAlias, dateDocumentType, createDayDocuments);

            Document.New += DocumentNew;
            Document.BeforePublish += DocumentBeforePublish;
        }
示例#2
0
 /// <summary>
 /// Constructor for unit tests, ensures some resolvers are not initialized
 /// </summary>
 /// <param name="umbracoApplication"></param>
 /// <param name="isForTesting"></param>
 internal WebBootManager(UmbracoApplication umbracoApplication, bool isForTesting)
 {
     _isForTesting       = isForTesting;
     _umbracoApplication = umbracoApplication;
     if (umbracoApplication == null)
     {
         throw new ArgumentNullException("umbracoApplication");
     }
 }
示例#3
0
		public void OnApplicationStarting(UmbracoApplication httpApplication, Core.ApplicationContext applicationContext)
		{
			// time to setup the tasks

			// these are the legacy tasks
			// just copied over here for backward compatibility
			// of course we should have a proper scheduler, see #U4-809

			// ping/keepalive
			pingTimer = new Timer(new TimerCallback(global::umbraco.presentation.keepAliveService.PingUmbraco), httpApplication.Context, 60000, 300000);

			// (un)publishing _and_ also run scheduled tasks (!)
			publishingTimer = new Timer(new TimerCallback(global::umbraco.presentation.publishingService.CheckPublishing), httpApplication.Context, 30000, 60000);

			// log scrubbing
			AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval());
		}
示例#4
0
            public void OnApplicationInitialized(UmbracoApplication httpApplication, ApplicationContext applicationContext)
            {
                if (ApplicationContext.Current != null)
                {
                    //bind to events to clear the cache, after publish, after media save and after member save

                    Document.AfterPublish
                        += (sender, args) =>
                           ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();

                    global::umbraco.cms.businesslogic.media.Media.AfterSave
                        += (sender, args) =>
                           ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();

                    global::umbraco.cms.businesslogic.member.Member.AfterSave
                        += (sender, args) =>
                           ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();
                }
            }
			public void OnApplicationInitialized(UmbracoApplication httpApplication, ApplicationContext applicationContext)
			{
				if (ApplicationContext.Current != null)
				{
					//bind to events to clear the cache, after publish, after media save and after member save

					Document.AfterPublish
						+= (sender, args) =>
						   ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();

					global::umbraco.cms.businesslogic.media.Media.AfterSave
						+= (sender, args) =>
						   ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();

					global::umbraco.cms.businesslogic.member.Member.AfterSave
						+= (sender, args) =>
						   ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();
				}
			}
示例#6
0
		/// <summary>
		/// Constructor for unit tests, ensures some resolvers are not initialized
		/// </summary>
		/// <param name="umbracoApplication"></param>
		/// <param name="isForTesting"></param>
		internal WebBootManager(UmbracoApplication umbracoApplication, bool isForTesting)
		{
			_isForTesting = isForTesting;
			_umbracoApplication = umbracoApplication;
			if (umbracoApplication == null) throw new ArgumentNullException("umbracoApplication");
		}
示例#7
0
		public WebBootManager(UmbracoApplication umbracoApplication)
			: this(umbracoApplication, false)
		{
		}
示例#8
0
 public void OnApplicationStarted(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
 }
 public void OnApplicationStarting(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
 }
 public void OnApplicationInitialized(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
 }
示例#11
0
 public void OnApplicationInitialized(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
     Document.New += DocumentNew;
     Document.AfterPublish += AfterPublish;
 }
 public void OnApplicationStarted(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
     umbraco.macro.Error += macro_Error;
 }
示例#13
0
 public WebBootManager(UmbracoApplication umbracoApplication)
     : this(umbracoApplication, false)
 {
 }
示例#14
0
 public void OnApplicationStarting(UmbracoApplication httpApplication, ApplicationContext applicationContext)
 {
     Media.AfterSave += Media_AfterSave;
 }
示例#15
0
		public void OnApplicationStarted(UmbracoApplication httpApplication, Core.ApplicationContext applicationContext)
		{
			// nothing
		}
示例#16
0
		public void OnApplicationInitialized(UmbracoApplication httpApplication, Core.ApplicationContext applicationContext)
		{
			// nothing yet
		}