Discussion:
How to implement buildCriteriaScript(entry) api
Add Reply
Sufyan Khan
2018-10-04 12:25:49 UTC
Reply
Permalink
I have scripted LDAP connector to do a lookup so I have prepared a search criteria (using SearchCriteria class and addCriteria & setType APIs).

Now I have to build a filter which would have mixed '&' and '|' conditions which as per my understanding cannot be achieved using the above way so from javadocs I found buildCriteriaScript API which can help, but I am not able to implement this.

Could anyone help me in this?


Regards,
Sufyan
Eddie Hartman
2018-10-04 17:19:57 UTC
Reply
Permalink
Post by Sufyan Khan
I have scripted LDAP connector to do a lookup so I have prepared a search criteria (using SearchCriteria class and addCriteria & setType APIs).
Now I have to build a filter which would have mixed '&' and '|' conditions which as per my understanding cannot be achieved using the above way so from javadocs I found buildCriteriaScript API which can help, but I am not able to implement this.
Could anyone help me in this?
Regards,
Sufyan
You could try setting the ldapSearchFilter parameter instead. Here you can craft your own LDAP search filter as complex as you like.

/Eddie
Eddie Hartman
2018-10-04 17:20:57 UTC
Reply
Permalink
Post by Sufyan Khan
I have scripted LDAP connector to do a lookup so I have prepared a search criteria (using SearchCriteria class and addCriteria & setType APIs).
Now I have to build a filter which would have mixed '&' and '|' conditions which as per my understanding cannot be achieved using the above way so from javadocs I found buildCriteriaScript API which can help, but I am not able to implement this.
Could anyone help me in this?
Regards,
Sufyan
Of course, then you will not use findEntry(), but instead selectEntries() to search and getNextEntry() to return entries from the result set.

Complete thought now :)

/Eddie
Sufyan Khan
2018-10-05 18:21:50 UTC
Reply
Permalink
Hi Eddie,

Thanks, this would work.

Just for learning, if I want to use buildCriteriaScript API, how to implement it?


Thanks,
Sufyan

Loading...