-
1. Re: Is there an easy way to find IdentityTypes by role?
noamichael Mar 21, 2014 11:28 PM (in response to noamichael)I'm also facing the problem with custom queries when trying to implement a autocomplete search for users. I'm using primefaces autocomplete component, and it's taking in a list of my custom user types. The only way to do this is use my own entity manager to get the results. My query is basically "SELECT U FROM CustomUserEntity U where U.loginName LIKE :loginName %". This will return a list of user entities just fine, but I'd like to use them with the Identity Manager so they must be CustomUser.class Objects. This means I have to iterate over the list of entities and convert them into the POJO CustomUser class:
for(CustomUserEntity User: query.getResultsList()){
userList.add(new CustomUser(user.loginName, user.firstName...etc));
}This works, but it terribly inefficient. It would be awesome if there was another way.
-
2. Re: Is there an easy way to find IdentityTypes by role?
pcraveiro Mar 26, 2014 11:58 AM (in response to noamichael)Hi Machael,
What you did is fine. Currently, this is the solution you should use to get the assignees for a given role. You can use something similar to also get the members of a Group.
FYI, You can also get all relationships for a given IdentityType by using the Relationship.IDENTITY parameter.
The only issue I can see in this solution is that you probably want only the id and loginName from the User, but PicketLink is loading all data for each User. But once we get the cache done, I think this would not be a problem anymore.
Is this impacting the performance of your application ?
Thanks.
-
3. Re: Is there an easy way to find IdentityTypes by role?
pcraveiro Mar 26, 2014 12:05 PM (in response to noamichael)Hi Michael,
Queries based on string fields (like loginName) are not considering patterns, but matching the exact value. I think we need to support that OOTB. Your use case makes a lot of sense.
We can probably provide some additional configuration to the Query API so you can specify how a specific field should be matched.
Can you open a JIRA ?
Thanks !
-
4. Re: Is there an easy way to find IdentityTypes by role?
noamichael Mar 26, 2014 4:23 PM (in response to pcraveiro)If this is the only way to preform the query, then I am completely okay with it. I submitted a JIRA for the other issue of creating queries with partial Strings or a pattern here.
Thanks for the reply!
-Michael