public ContentSource GetContentSource(Content content, Configuration myConfiguration, ContentSourceCollection contentSources)
        {
            var businessSource                  = myConfiguration.ContentSourceConfiguration as BusinessSourceConfiguration;
            var businessContentSource           = (BusinessDataContentSource)contentSources.Create(typeof(BusinessDataContentSource), myConfiguration.ContentSourceConfiguration.ContentSourceName);
            var bdcServiceApplicationProxyGroup = GetSPServiceApplicationProxyGroup();

            SetBusinessDataContentSourceStartAddress(businessContentSource, bdcServiceApplicationProxyGroup, myConfiguration);

            businessContentSource.Update();

            return(businessContentSource);
        }
        public ContentSource GetContentSource(Content content, Configuration myConfiguration, ContentSourceCollection contentSources)
        {
            var fileSource = myConfiguration.ContentSourceConfiguration as FileSourceConfiguration;
            FileShareContentSource fileContentSource = (FileShareContentSource)contentSources.Create(typeof(FileShareContentSource), myConfiguration.ContentSourceConfiguration.ContentSourceName);

            foreach (var startAddress in myConfiguration.ContentSourceConfiguration.StartAddresses)
            {
                fileContentSource.StartAddresses.Add(new Uri(startAddress));
            }
            fileContentSource.FollowDirectories = fileSource.CrawlSettings;

            fileContentSource.Update();

            return(fileContentSource);
        }
Esempio n. 3
0
        public ContentSource GetContentSource(Content content, Configuration myConfiguration, ContentSourceCollection contentSources)
        {
            var webSource        = myConfiguration.ContentSourceConfiguration as WebSourceConfiguration;
            var webContentSource = (WebContentSource)contentSources.Create(typeof(WebContentSource), myConfiguration.ContentSourceConfiguration.ContentSourceName);

            foreach (var startAddress in myConfiguration.ContentSourceConfiguration.StartAddresses)
            {
                webContentSource.StartAddresses.Add(new Uri(startAddress));
            }
            var crawlSettingsConfiguration = webSource.CrawlSettingsConfiguration;

            webContentSource.MaxPageEnumerationDepth = crawlSettingsConfiguration.MaxPageEnumerationDepth.HasValue ? crawlSettingsConfiguration.MaxPageEnumerationDepth.Value : Int32.MaxValue;
            webContentSource.MaxSiteEnumerationDepth = crawlSettingsConfiguration.MaxSiteEnumerationDepth.HasValue ? crawlSettingsConfiguration.MaxSiteEnumerationDepth.Value : Int32.MaxValue;

            webContentSource.Update();

            return(webContentSource);
        }
Esempio n. 4
0
        public ContentSource GetContentSource(Content content, Configuration myConfiguration, ContentSourceCollection contentSources)
        {
            var sharePointSource        = myConfiguration.ContentSourceConfiguration as SharePointSourceConfiguration;
            var sharepointCrawlBehavior = sharePointSource.CrawlSettings ? SharePointCrawlBehavior.CrawlVirtualServers : SharePointCrawlBehavior.CrawlSites;
            SharePointContentSource sharepointContentSource = (SharePointContentSource)contentSources.Create(typeof(SharePointContentSource), sharepointCrawlBehavior, myConfiguration.ContentSourceConfiguration.ContentSourceName);

            foreach (var startAddress in myConfiguration.ContentSourceConfiguration.StartAddresses)
            {
                sharepointContentSource.StartAddresses.Add(new Uri(startAddress));
            }
            sharepointContentSource.EnableContinuousCrawls = sharePointSource.EnableContinuousCrawls;

            sharepointContentSource.Update();

            return(sharepointContentSource);
        }
        public ContentSource GetContentSource(Content content, Configuration myConfiguration, ContentSourceCollection contentSources)
        {
            var exchangeSource = myConfiguration.ContentSourceConfiguration as ExchangeSourceConfiguration;
            ExchangePublicFolderContentSource exchangeContentSource = (ExchangePublicFolderContentSource)contentSources.Create(typeof(ExchangePublicFolderContentSource), myConfiguration.ContentSourceConfiguration.ContentSourceName);

            foreach (var startAddress in myConfiguration.ContentSourceConfiguration.StartAddresses)
            {
                exchangeContentSource.StartAddresses.Add(new Uri(startAddress));
            }
            exchangeContentSource.FollowDirectories = exchangeSource.CrawlSettings;
            exchangeContentSource.Update();

            return(exchangeContentSource);
        }