Exemplo n.º 1
0
        public AnalyticsIndexBuilderPage()
        {
            var pageLogger = (ILoggingService)Factory.CreateObject("helpfulcore/analytics.index.builder/logging/pageLoggingService", true);

            this.AnalyticsSearchService = (IAnalyticsSearchService)Factory.CreateObject("helpfulcore/analytics.index.builder/analyticsSearchService", true);
            this.LogQueue = (ProcessQueueLoggingProvider)Factory.CreateObject("helpfulcore/analytics.index.builder/logging/providers/indexingQueueLog", true);

            if (AnalyticsIndexBuilder == null)
            {
                lock (InitializationSyncRoot)
                {
                    if (AnalyticsIndexBuilder == null)
                    {
                        // need to create specific static instance so it uses page logger.
                        AnalyticsIndexBuilder = (IAnalyticsIndexBuilder)Factory.CreateObject("helpfulcore/analytics.index.builder/analyticsIndexBuilder", true);
                        AnalyticsIndexBuilder.ChangeLogger(pageLogger);
                    }
                }
            }

            this.AnalyticsSearchService.ChangeLogger(pageLogger);
            this.AnalyticsIndexFacets = new AnalyticsIndexablesFacetResult();
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.CheckSecurity();

            var task = this.Request.QueryString["task"];

            if (!string.IsNullOrWhiteSpace(task))
            {
                this.Response.Clear();

                if (task == "GetLogProgress")
                {
                    this.GetLogProgress();
                }
                if (task == "GetFacets")
                {
                    this.GetFacets();
                }

                if (task == "rebuild-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildAllIndexables(true); });
                }
                if (task == "rebuild-contact-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildContactIndexables(true); });
                }
                if (task == "rebuild-address-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildAddressIndexables(true); });
                }
                if (task == "rebuild-contactTag-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildContactTagIndexables(true); });
                }
                if (task == "rebuild-visit-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitIndexables(true); });
                }
                if (task == "rebuild-visitPage-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitPageIndexables(true); });
                }
                if (task == "rebuild-visitPageEvent-filtered")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitPageEventIndexables(true); });
                }

                if (task == "rebuild")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildAllIndexables(false); });
                }
                if (task == "rebuild-contact")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildContactIndexables(false); });
                }
                if (task == "rebuild-address")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildAddressIndexables(false); });
                }
                if (task == "rebuild-contactTag")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildContactTagIndexables(false); });
                }
                if (task == "rebuild-visit")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitIndexables(false); });
                }
                if (task == "rebuild-visitPage")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitPageIndexables(false); });
                }
                if (task == "rebuild-visitPageEvent")
                {
                    this.StartAsyncAction(() => { AnalyticsIndexBuilder.RebuildVisitPageEventIndexables(false); });
                }

                if (task == "delete")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.ResetIndex(); });
                }
                if (task == "delete-contact")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("contact"); });
                }
                if (task == "delete-contactTag")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("contacttag"); });
                }
                if (task == "delete-address")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("address"); });
                }
                if (task == "delete-visit")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("visit"); });
                }
                if (task == "delete-visitPage")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("visitpage"); });
                }
                if (task == "delete-visitPageEvent")
                {
                    this.StartAsyncAction(() => { this.AnalyticsSearchService.DeleteIndexablesByType("visitpageevent"); });
                }

                this.Response.End();

                return;
            }

            this.AnalyticsIndexFacets = this.AnalyticsSearchService.GetAnalyticsIndexFacets();
        }