Esempio n. 1
0
        public static void Configure()
        {
            DbRegistry.Configure();

            PrepareRedisSessionProvider();

            if (HttpContext.Current != null && HttpContext.Current.Request != null)
            {
                var url = HttpContext.Current.Request.GetUrlRewriter();
                CommonLinkUtility.Initialize(new UriBuilder(url.Scheme, url.Host, url.Port).Uri.ToString());
            }

            ConfigureWebApi();

            if (DBResourceManager.ResourcesFromDataBase)
            {
                DBResourceManager.WhiteLableEnabled = true;
                DBResourceManager.PatchAssemblies();
            }

            AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;
            AppDomain.CurrentDomain.AssemblyResolve             += CurrentDomainOnAssemblyResolve;

            //try
            //{
            //    AmiPublicDnsSyncService.Synchronize();
            //}
            //catch { }

            NotifyConfiguration.Configure();

            WebItemManager.Instance.LoadItems();

            SearchHandlerManager.Registry(new StudioSearchHandler());

            StorageFactory.InitializeHttpHandlers();

            BundleConfig.Configure();

            WhiteLabelHelper.ApplyPartnerWhiteLableSettings();

            LdapNotifyHelper.RegisterAll();

            try
            {
                new S3UploadGuard().DeleteExpiredUploadsAsync(TimeSpan.FromDays(1));//todo:
            }
            catch (Exception)
            {
            }

            try
            {
                Core.WarmUp.Instance.Start();
            }
            catch (Exception ex)
            {
                LogManager.GetLogger("ASC").Error("Start Warmup", ex);
            }
        }
Esempio n. 2
0
        public static void Configure(HttpApplication application)
        {
            XmlConfigurator.Configure();

            DbRegistry.Configure();

            ConfigureWebApi();

            if (ConfigurationManager.AppSettings["resources.from-db"] == "true")
            {
                AssemblyWork.UploadResourceData(AppDomain.CurrentDomain.GetAssemblies());
                AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => AssemblyWork.UploadResourceData(AppDomain.CurrentDomain.GetAssemblies());
            }

            AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;

            try
            {
                AmiPublicDnsSyncService.Synchronize();
            }
            catch { }

            NotifyConfiguration.Configure();

            WebItemManager.Instance.LoadItems();

            SearchHandlerManager.Registry(new StudioSearchHandler());

            StorageFactory.InitializeHttpHandlers();
            (new S3UploadGuard()).DeleteExpiredUploads(TimeSpan.FromDays(1));

            BundleConfig.Configure();
        }
Esempio n. 3
0
        public override void Init()
        {
            List <string> adminOpportunities() => (CoreBaseSettings.CustomMode
                                                               ? CustomModeResource.ProductAdminOpportunitiesCustomMode
                                                               : FilesCommonResource.ProductAdminOpportunities).Split('|').ToList();

            List <string> userOpportunities() => (CoreBaseSettings.CustomMode
                                         ? CustomModeResource.ProductUserOpportunitiesCustomMode
                                         : FilesCommonResource.ProductUserOpportunities).Split('|').ToList();

            _productContext =
                new ProductContext
            {
                DisabledIconFileName = "product_disabled_logo.png",
                IconFileName         = "images/files.menu.svg",
                LargeIconFileName    = "images/files.svg",
                DefaultSortOrder     = 10,
                //SubscriptionManager = SubscriptionManager,
                //SpaceUsageStatManager = FilesSpaceUsageStatManager,
                AdminOpportunities = adminOpportunities,
                UserOpportunities  = userOpportunities,
                CanNotBeDisabled   = true,
            };

            if (NotifyConfiguration != null)
            {
                NotifyConfiguration.Configure();
            }
            //SearchHandlerManager.Registry(new SearchHandler());
        }
Esempio n. 4
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            NotifyConfiguration.Configure(ServiceProvider);
            WebItemManager.LoadItems();

            StudioNotifyServiceSender.RegisterSendMethod();

            return(Task.CompletedTask);
        }
Esempio n. 5
0
 private void InitializeNotifySchedulers()
 {
     NotifyConfiguration.Configure();
     foreach (var pair in NotifyServiceCfg.Schedulers.Where(r => r.MethodInfo != null))
     {
         Log.DebugFormat("Start scheduler {0} ({1})", pair.Name, pair.MethodInfo);
         pair.MethodInfo.Invoke(null, null);
     }
 }
Esempio n. 6
0
 protected void Application_Start(object sender, EventArgs e)
 {
     XmlConfigurator.Configure();
     DbRegistry.Configure();
     InitializeDbResources();
     AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;
     NotifyConfiguration.Configure();
     WebItemManager.Instance.LoadItems();
     SearchHandlerManager.Registry(new StudioSearchHandler());
     SearchHandlerManager.Registry(new EmployeeSearchHendler());
 }
Esempio n. 7
0
 private void InitializeNotifySchedulers()
 {
     CommonLinkUtility.Initialize(NotifyServiceCfg.ServerRoot);
     DbRegistry.Configure();
     NotifyConfiguration.Configure();
     WebItemManager.LoadItems();
     foreach (var pair in NotifyServiceCfg.Schedulers.Where(r => r.MethodInfo != null))
     {
         LogManager.GetLogger("ASC.Notify").DebugFormat("Start scheduler {0} ({1})", pair.Name, pair.MethodInfo);
         pair.MethodInfo.Invoke(null, null);
     }
 }
Esempio n. 8
0
 private void InitializeNotifySchedulers()
 {
     CommonLinkUtility.Initialize(NotifyServiceCfg.ServerRoot);
     DbRegistry.Configure();
     InitializeDbResources();
     NotifyConfiguration.Configure();
     WebItemManager.Instance.LoadItems();
     foreach (var pair in NotifyServiceCfg.Schedulers)
     {
         LogManager.GetLogger("ASC.Notify").DebugFormat("Start scheduler {0} ({1})", pair.Key, pair.Value);
         pair.Value.Invoke(null, null);
     }
 }
Esempio n. 9
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            NotifyConfiguration.Configure(ServiceProvider);

            var settings = Configuration.GetSetting <BackupSettings>("backup");

            BackupWorker.Start(settings);
            BackupListener.Start();

            CleanerService.Period = settings.Cleaner.Period;
            CleanerService.Start();

            SchedulerService.Period = settings.Scheduler.Period;
            SchedulerService.Start();

            return(Task.CompletedTask);
        }
Esempio n. 10
0
 private void Application_StartDelayed(object sender, EventArgs e)
 {
     XmlConfigurator.Configure();
     DbRegistry.Configure();
     InitializeDbResources();
     AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;
     try
     {
         AmiPublicDnsSyncService.Synchronize();
     }
     catch { }
     NotifyConfiguration.Configure();
     WebItemManager.Instance.LoadItems();
     SearchHandlerManager.Registry(new StudioSearchHandler());
     (new S3UploadGuard()).DeleteExpiredUploads(TimeSpan.FromDays(1));
     BundleConfig.Configure();
 }
Esempio n. 11
0
        public static void Configure()
        {
            XmlConfigurator.Configure();

            DbRegistry.Configure();

            PrepareRedisSessionProvider();

            if (HttpContext.Current != null && HttpContext.Current.Request != null)
            {
                var url = HttpContext.Current.Request.GetUrlRewriter();
                CommonLinkUtility.Initialize(new UriBuilder(url.Scheme, url.Host, url.Port).Uri.ToString());
            }

            ConfigureWebApi();

            if (ConfigurationManager.AppSettings["resources.from-db"] == "true")
            {
                DBResourceManager.PatchAssemblies();
            }

            AjaxSecurityChecker.Instance.CheckMethodPermissions += AjaxCheckMethodPermissions;

            try
            {
                AmiPublicDnsSyncService.Synchronize();
            }
            catch { }

            NotifyConfiguration.Configure();

            WebItemManager.Instance.LoadItems();

            SearchHandlerManager.Registry(new StudioSearchHandler());

            StorageFactory.InitializeHttpHandlers();
            (new S3UploadGuard()).DeleteExpiredUploads(TimeSpan.FromDays(1));

            BundleConfig.Configure();

            if (CoreContext.Configuration.Standalone)
            {
                WarmUp.Instance.Start();
            }
        }