public DefaultWebCrawlerService(ICmsConfiguration cmsConfiguration)
        {
            this.cmsConfiguration = cmsConfiguration;

            webServer = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneWebSiteUrl) ?? string.Empty;

            bool.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexPrivatePages), out indexPrivatePages);

            if (indexPrivatePages)
            {
                var authModeString = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneAuthorizationMode);
                if (!string.IsNullOrWhiteSpace(authModeString))
                {
                    switch (authModeString.ToLower().Trim())
                    {
                        case "windows":
                            authMode = AuthMode.Windows;
                            break;
                        default:
                            authMode = AuthMode.Forms;
                            break;
                    }
                }
            }

            HtmlAgilityPackHelper.FixMissingTagClosings();

            TimeSpan timeout;
            if (TimeSpan.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexerPageFetchTimeout), out timeout)
                && timeout > TimeSpan.FromSeconds(0))
            {
                fetchTimeout = timeout;
            }
        }
Example #2
0
        public DefaultWebCrawlerService(ICmsConfiguration cmsConfiguration)
        {
            this.cmsConfiguration = cmsConfiguration;

            webServer = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneWebSiteUrl) ?? string.Empty;

            bool.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexPrivatePages), out indexPrivatePages);

            HtmlAgilityPackHelper.FixMissingTagClosings();
        }
Example #3
0
        public DefaultWebCrawlerService(ICmsConfiguration cmsConfiguration)
        {
            this.cmsConfiguration = cmsConfiguration;

            webServer = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneWebSiteUrl) ?? string.Empty;

            bool.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexPrivatePages), out indexPrivatePages);

            HtmlAgilityPackHelper.FixMissingTagClosings();

            TimeSpan timeout;

            if (TimeSpan.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexerPageFetchTimeout), out timeout) &&
                timeout > TimeSpan.FromSeconds(0))
            {
                fetchTimeout = timeout;
            }
        }
Example #4
0
        static TestBase()
        {
            KnownAssemblies = new List <Assembly>(new[]
            {
                typeof(RootModuleDescriptor).Assembly,
                typeof(PagesModuleDescriptor).Assembly,
                typeof(BlogModuleDescriptor).Assembly,
                typeof(NewsletterModuleDescriptor).Assembly,
                typeof(MediaManagerModuleDescriptor).Assembly,
                typeof(UsersModuleDescriptor).Assembly,
                typeof(ApiModuleDescriptor).Assembly,
                typeof(UsersApiModuleDescriptor).Assembly,
                typeof(ImagesGalleryModuleDescriptor).Assembly
            });
            CreateContainer();

            HtmlAgilityPackHelper.FixMissingTagClosings();
        }