cancel
Showing results for 
Search instead for 
Did you mean: 

Does UserFilter work with queryUsers?

dongq
Champ in-the-making
Champ in-the-making
Hi, I am trying to apply a filter to queryUsers, but it didn't work. I still get all the users in the repository.

Here is my code:
ArrayList<User> ulist = new ArrayList<User>();
AuthenticationUtils.startSession(admin, adminpwd);
AdministrationServiceSoapBindingStub administrationService = WebServiceFactory.getAdministrationService();
UserFilter filter = new UserFilter("test*");
UserQueryResults results = administrationService.queryUsers(filter);
while(true)
{
              for (UserDetails details : results.getUserDetails())
              {
                    String userName = details.getUserName();
                    User u = new User(userName);
                    ulist.add(u);
                }
               
              if (results.getQuerySession() == null)
                break;
               
              results = administrationService.fetchMoreUsers(results.getQuerySession());
}

Right now, I am just doing my own filtering. However, I want know if I am misusing the UserFilter or if it just doesn't work.

Thanks.

Qing
3 REPLIES 3

alexcocia
Champ in-the-making
Champ in-the-making
It didn't work for me either,

Downloaded  last version (2.1) and it works now… try it out.

Alex

dongq
Champ in-the-making
Champ in-the-making
I am using web service 2.1 sdk against a 2.1E repository. I still can't do wildcard search using UserFilter.

dongq
Champ in-the-making
Champ in-the-making
Oh, ok, I got it now. UserFilter uses regex. To search for any user that starts with "test", the filter needs to be

UserFilter filter = new UserFilter("^test.*");