directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r746484 - /directory/sandbox/szoerner/groovyldap/src/main/groovy/demoSearch.groovy
Date Sat, 21 Feb 2009 11:02:23 GMT
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



Mime
View raw message