共用方式為


SPClaimProvider.FillSearch method

衍生的類別中實作時,會填滿人員選擇 」 控制項視窗中的搜尋結果。

Namespace:  Microsoft.SharePoint.Administration.Claims
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Protected MustOverride Sub FillSearch ( _
    context As Uri, _
    entityTypes As String(), _
    searchPattern As String, _
    hierarchyNodeID As String, _
    maxCount As Integer, _
    searchTree As SPProviderHierarchyTree _
)
'用途
Dim context As Uri
Dim entityTypes As String()
Dim searchPattern As String
Dim hierarchyNodeID As String
Dim maxCount As Integer
Dim searchTree As SPProviderHierarchyTree

Me.FillSearch(context, entityTypes, _
    searchPattern, hierarchyNodeID, _
    maxCount, searchTree)
protected abstract void FillSearch(
    Uri context,
    string[] entityTypes,
    string searchPattern,
    string hierarchyNodeID,
    int maxCount,
    SPProviderHierarchyTree searchTree
)

參數

  • context
    Type: System.Uri

    為 URI 內容。這必須是格式正確的 URI。

  • entityTypes
    Type: []

    若要搜尋的範圍設**[P:HYPERLINK"mk:@MSITStore:D:\\\\aSDK\\\\SP2010SDK.chm::/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.PickerEntity.EntityType]**實體類型。

  • hierarchyNodeID
    Type: System.String

    階層節點的唯一識別碼。

  • maxCount
    Type: System.Int32

    Int32值包含在清單中要傳回的提供者數目上限。

備註

如果您想要能夠搜尋宣告人員選擇 」 控制項中,您必須實作此方法與**[P:HYPERLINK"ms-help://MS.SPS14SDK.en/SPF14MrefAdmin/html/ba710e89-6180-0fec-fb79-090451f9ee43.htm"Microsoft.SharePoint.Administration.Claims.SupportSearch]**屬性。

SupportsSearch必須傳回true。

示範目的搜尋功能僅支援完整名稱搜尋。如您所見,宣告提供者支援兩種宣告的為主體: SalesManager 和 RegionManager。他們可以是這些用來保護 SharePoint 物件,就像**FillEntityTypes()**參考主題中的程式碼範例會用來執行同樣的事情 ASP.NET 角色。

您也必須實作採用SPClaim參數**FillResolve()方法。這個方法用於解決一個單一的宣告驗證的宣告存在。[人員選擇先搜尋使用FillSearch()方法的宣告。一旦使用者只會挑選一個宣告,「 人員選擇 」 呼叫FillResolve()**一次驗證。

Sample code provided by:Andy Li,Microsoft Corporation。

Examples


// Returns true if you support claim search in the People Picker control.
public override bool SupportsSearch
{
    get { return true; }
}
protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID, int maxCount, SPProviderHierarchyTree searchTree)
        {
            if (searchPattern.ToUpper() == "SALESMANAGER")
            {
                PickerEntity entity = CreatePickerEntity();
                entity.Claim = CreateClaim(CRMClaimType.Role, CRMRoleValue.SalesManager, Microsoft.IdentityModel.Claims.ClaimValueTypes.String);
                entity.Description = CRMRoleValue.SalesManager;
                entity.DisplayText = CRMRoleValue.SalesManager;
                entity.EntityData[PeopleEditorEntityDataKeys.DisplayName] = CRMRoleValue.SalesManager;
                entity.EntityType = SPClaimEntityTypes.FormsRole;
                entity.IsResolved = true;
                searchTree.AddEntity(entity);
            }
            if (searchPattern.ToUpper() == "REGIONMANAGER")
            {
                PickerEntity entity = CreatePickerEntity();
                entity.Claim = CreateClaim(CRMClaimType.Role, CRMRoleValue.RegionManager, Microsoft.IdentityModel.Claims.ClaimValueTypes.String);
                entity.Description = CRMRoleValue.RegionManager;
                entity.DisplayText = CRMRoleValue.RegionManager;
                entity.EntityData[PeopleEditorEntityDataKeys.DisplayName] = CRMRoleValue.RegionManager;
                entity.EntityType = SPClaimEntityTypes.FormsRole;
                entity.IsResolved = true;
                searchTree.AddEntity(entity);
            }
        }

請參閱

參照

SPClaimProvider class

SPClaimProvider members

Microsoft.SharePoint.Administration.Claims namespace