protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID, int maxCount, Microsoft.SharePoint.WebControls.SPProviderHierarchyTree searchTree) { if (!entityTypes.Contains(SPClaimEntityTypes.Trusted)) { return; } var organizationMatches = SearchOrganizations(searchPattern); if (organizationMatches.Count() > 0) { var matchNode = new SPProviderHierarchyNode( ProviderInternalName, filters[OrganizationKey], OrganizationKey, true); searchTree.AddChild(matchNode); foreach (var match in organizationMatches) { PickerEntity pe = GetPickerEntity(match, OrganizationClaimType, filters[OrganizationKey]); matchNode.AddEntity(pe); } } var roleMatches = SearchRoles(searchPattern); if (roleMatches.Count() > 0) { var matchNode = new SPProviderHierarchyNode( ProviderInternalName, filters[RoleKey], RoleKey, true); searchTree.AddChild(matchNode); foreach (var match in roleMatches) { PickerEntity pe = GetPickerEntity(match, Microsoft.IdentityModel.Claims.ClaimTypes.Role, filters[RoleKey]); matchNode.AddEntity(pe); } } }
protected override void FillHierarchy(Uri context, string[] entityTypes, string hierarchyNodeID, int numberOfLevels, Microsoft.SharePoint.WebControls.SPProviderHierarchyTree hierarchy) { //Make sure picker is asking for the type of entity we return; site collection admin won't for example. if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) { return; } //Check to see if the hierarchyNodeID is null; it will be when the control //is first loaded but if a user clicks on one of the nodes it will return //the key of the node that was clicked. switch (hierarchyNodeID) { case null: //When it first loads add all our nodes. hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode( SqlClaims.ProviderInternalName, teamLabels[0], teamKeys[0], true)); hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode( SqlClaims.ProviderInternalName, teamLabels[1], teamKeys[1], true)); hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode( SqlClaims.ProviderInternalName, teamLabels[2], teamKeys[2], true)); break; default: break; } }
protected override void FillSearch(Uri context, string[] entityTypes, string searchPattern, string hierarchyNodeID, int maxCount, Microsoft.SharePoint.WebControls.SPProviderHierarchyTree searchTree) { //Make sure search is asking for the type of entity we return; site collection admin won't for example. if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) { return; } //Counter to track what node we are in. int teamNode = -1; //Nodes where we will stick our matches. Microsoft.SharePoint.WebControls.SPProviderHierarchyNode matchNode = null; //Look to see if the value that is typed in matches any of our teams. foreach (string team in ourTeams) { //Increment team node tracker. teamNode += 1; if (team.ToLower().StartsWith(searchPattern.ToLower())) { //We have a match, create a matching entity. PickerEntity pe = GetPickerEntity(team); //Add the team node where it should be displayed too. if (!searchTree.HasChild(teamKeys[teamNode])) { //Create the node so we can show our match in there too. matchNode = new SPProviderHierarchyNode(SqlClaims.ProviderInternalName, teamLabels[teamNode], teamKeys[teamNode], true); //Add it to the tree. searchTree.AddChild(matchNode); } else { //Get the node for this team. matchNode = searchTree.Children.Where(theNode => theNode.HierarchyNodeID == teamKeys[teamNode]).First(); } //Add the match to our node. matchNode.AddEntity(pe); } } }
protected override void FillHierarchy(Uri context, string[] entityTypes, string hierarchyNodeID, int numberOfLevels, Microsoft.SharePoint.WebControls.SPProviderHierarchyTree hierarchy) { if (!entityTypes.Contains(SPClaimEntityTypes.Trusted)) { return; } if (hierarchyNodeID == null) { foreach (var filter in filters) { hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode( ProviderInternalName, filter.Value, filter.Key, true)); } } }
protected override void FillHierarchy(Uri context, string[] entityTypes, string hierarchyNodeID, int numberOfLevels, Microsoft.SharePoint.WebControls.SPProviderHierarchyTree hierarchy) { hierarchy.AddChild(new Microsoft.SharePoint.WebControls.SPProviderHierarchyNode("ZimbraClaimProvider", "Users", "Users", true)); }