Monday, May 18, 2009

Search users in LDAP

Here you can search users in LDAP by using the below code.

Note: DemoLDAP is the name of the resource which is configured in your IDM.

<Activity id='2' name='search LDAP'>
<Action id='0' name='search LDAP'>
<block name='search LDAP..' trace='true'>
<set name='searchResults'>
<invoke name='getResourceObjects' class='com.waveset.ui.FormUtil'>
--returns list of users whose objectClass is Top in LDAP
<invoke name='getLighthouseContext'>
<s>User</s> --- Searching Users
<s>DemoLDAP</s>  -------- Name of LDAP resource which is configured in IDM
<s>searchContext</s> ---Name of container wherein you want to  perform  search
<s>searchAttrsToGet</s> --- name of attribute which you want to search (it's value must be a list)
<s>searchFilter</s>  ----- attributes on which you want to perfomr your search   
<dolist name='users'>
<ref>searchResults</ref> ----List of users being searched in above method
<s>uid</s>  ---- attribute that you wanted to fetch

searchFilter value could be changed as per your search criteria e.g givenName='John' or city='New York'.