カスタムクレームプロバイダ - 人々ピッカーに表示されない結果
-
28-09-2020 - |
質問
私はカスタムクレームプロバイダを実装しました。People Picterに用語を入力すると、プロバイダに問い合わせて、一致するPickerentityオブジェクトのリストを返します。
デバッグには、Pickerentityオブジェクトの正しい数がSharePointに送信されているが、People Pickerがそれらを表示しないことを示しています。ただし、x結果を示す 'x結果を示す文字列が表示されます。ここで、xが表示されるべき結果の数と一致します。
My FillSearchメソッドは次のとおりです。
protected override void FillSearch(Uri context, string[] entityTypes, string searchValue, string hierarchyNodeID, int maxCount, SPProviderHierarchyTree searchTree)
{
// Ensure that People Picker is asking for the type of entity that we
// return; site collection administrator will not return, for example.
if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole)) { return; }
List<PickerEntity> matches = new List<PickerEntity>();
/*
removed code that retrieves the matches
*/
searchTree.AddEntities(matches);
}
.
一致リストに移行するコードは、次の方法を呼び出すことによって行います。
private PickerEntity GetPickerEntity(string claimValue)
{
PickerEntity pickerEntity = CreatePickerEntity();
pickerEntity.Claim = CreateClaim(BaseClaimType, claimValue, StringClaimValueType);
pickerEntity.Description = ProviderDisplayName + ":" + claimValue;
pickerEntity.DisplayText = claimValue;
pickerEntity.EntityData[PeopleEditorEntityDataKeys.DisplayName] = claimValue;
pickerEntity.EntityType = SPClaimEntityTypes.FormsRole;
pickerEntity.IsResolved = true;
return pickerEntity;
}
.
どのようにして結果を表示できますか?
解決
これは起動問題であることがわかりました。カスタムプロバイダーコードの展開の間に、FillclaimTypesとFillclaimValueTypesメソッドが呼び出されていないことに気づいた。
私は
他のヒント
私はあなたの同じ問題を抱えていました。 それはFillclaimtypesメソッド上にありました。 メソッドに指定されたスキーマURLと、請求に割り当てられているスキーマURLとのミスマッチがあります。 同じスキーマURLを割り当てました。 詳細はこちらについて http.://www.lucacostante.com/item/41-custom-claims-provider-Results-NOT-Showing-in-Picker.html