Share via


SPClaimProvider.FillHierarchy method

When implemented in a derived class, provides the People Picker control with the ability to load portions of the [T:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyTree] tree from the claims provider and specifies the hierarchy for displaying the picker entities.

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

Syntax

'Declaration
Protected MustOverride Sub FillHierarchy ( _
    context As Uri, _
    entityTypes As String(), _
    hierarchyNodeID As String, _
    numberOfLevels As Integer, _
    hierarchy As SPProviderHierarchyTree _
)
'Usage
Dim context As Uri
Dim entityTypes As String()
Dim hierarchyNodeID As String
Dim numberOfLevels As Integer
Dim hierarchy As SPProviderHierarchyTree

Me.FillHierarchy(context, entityTypes, _
    hierarchyNodeID, numberOfLevels, _
    hierarchy)
protected abstract void FillHierarchy(
    Uri context,
    string[] entityTypes,
    string hierarchyNodeID,
    int numberOfLevels,
    SPProviderHierarchyTree hierarchy
)

Parameters

  • context
    Type: System.Uri

    The context, as a URI. This must be a properly formatted URI.

  • entityTypes
    Type: []

    The [P:HYPERLINK"mk:@MSITStore:D:\\\\aSDK\\\\SP2010SDK.chm::/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.PickerEntity.EntityType] entity types that are returned on the SPProviderHierarchyTree tree.

  • hierarchyNodeID
    Type: System.String

    The [P:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyNode.HierarchyNodeID] node. If a null reference (Nothing in Visual Basic) then the root is returned.

  • numberOfLevels
    Type: System.Int32

    The number of levels of hierarchy to return.

Remarks

If you want to display hierarchy on the left pane of the claims picker, you must implement this method and the SupportsHierarchy property in the SPClaimProvider class.

For more information claims picking and resolution, see How to: Create a claims provider in SharePoint 2013 and Claims provider in SharePoint 2013.

Examples

// Return true if you support hierarchy display in People Picker
public override bool SupportsHierarchy
{
    get { return true; }
}
protected override void FillHierarchy(Uri context, String[] entityTypes, String hierarchyNodeID, int numberOfLevels, SPProviderHierarchyTree hierarchy)
{
    if (String.IsNullOrEmpty(hierarchyNodeID))
{
                hierarchy.AddChild(CreateHierarchyNodeForNodeID(MyLoginNameClaimType));
                hierarchy.AddChild(CreateHierarchyNodeForNodeID(MyClaimType));
}
else if (String.Equals(hierarchyNodeID, MyLoginNameClaimType, StringComparison.Ordinal))
{
    hierarchy.Name = GetHierarchyNodeNameForNodeID(hierarchyNodeID);
}
else if (String.Equals(hierarchyNodeID, MyClaimType, StringComparison.Ordinal))
{
    hierarchy.Name = GetHierarchyNodeNameForNodeID(hierarchyNodeID);
}
}

See also

Reference

SPClaimProvider class

SPClaimProvider members

Microsoft.SharePoint.Administration.Claims namespace