You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sz...@apache.org on 2009/02/21 12:02:23 UTC
svn commit: r746484 -
/directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy
Author: szoerner
Date: Sat Feb 21 11:02:22 2009
New Revision: 746484
URL: http://svn.apache.org/viewvc?rev=746484&view=rev
Log:
Added some examples
Modified:
directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy
Modified: directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy?rev=746484&r1=746483&r2=746484&view=diff
==============================================================================
--- directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy (original)
+++ directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy Sat Feb 21 11:02:22 2009
@@ -2,8 +2,29 @@
ldap = LDAP.newInstance('ldap://zanzibar:10389/')
-results = ldap.search('(objectClass=*)', 'dc=example,dc=com', SearchScope.ONE)
+results = ldap.search('(objectClass=person)', 'dc=example,dc=com', SearchScope.ONE)
println " ${results.size} entries found ".center(40,'-')
for (entry in results) {
println entry.dn
}
+
+println ""
+
+results = ldap.search(filter: '(objectClass=person)', base: 'dc=example,dc=com', scope: 'ONE')
+println " ${results.size} entries found ".center(40,'-')
+for (entry in results) {
+ println entry.dn
+}
+
+println ""
+
+def params = new Search()
+params.filter='(objectClass=person)'
+params.base='dc=example,dc=com'
+params.scope=SearchScope.ONE
+
+results = ldap.search(params)
+println " ${results.size} entries found ".center(40,'-')
+for (entry in results) {
+ println entry.dn
+}
\ No newline at end of file