Question

J'ai la nécessité de définir par programme une source de contenu de données dans SharePoint 2010 en utilisant C # 2010. J'ai passé en revue les moyens de le faire à partir de Central Admin, et ai vu des extraits de MOSS 2007. Cependant, je ne l'ai pas localisé exemples de le faire en SP 2010. quelqu'un peut-il me diriger dans la bonne direction?

Merci beaucoup pour votre aide et des conseils.

Était-ce utile?

La solution

Cette devrait vous aider.

Autres conseils

Utilisation de l'API

        string strURL = "http://mySiteUrl";
        SearchContext searchContext;
        using (SPSite searchSite = new SPSite(strURL))
        {
            searchContext = SearchContext.GetContext(searchSite);
        }
        Content sspContent = new Content(searchContext);
        ContentSourceCollection sspContentSources = sspContent.ContentSources;
        BusinessDataContentSource bdcs = (BusinessDataContentSource)sspContentSources.Create(typeof(BusinessDataContentSource), "MyBdcContentSource");
        bdcs.StartAddresses.Add(BusinessDataContentSource.ConstructStartAddress("Default", new Guid("00000000-0000-0000-0000-000000000000"), "LOBSystemName", "LOBSystemInstanceName"));

Utilisation Powershell

$searchapp = Get-SPEnterpriseSearchServiceApplication "My Search Service Application Name"
$lobSystems = @("LOBSystemName1","LOBSystemNameInstance1")
$proxyGroup = Get-SPServiceApplicationProxyGroup -default
New-SPEnterpriseSearchCrawlContentSource -name "My Content Source Name" -searchapplication $searchApp -Type Business -LOBSystemSet $lobSystems -BDCApplicationProxyGroup $proxyGroup
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top