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;
}
}