Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="note" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>This package is not actively maintained, but it will be re-released once it has been reworked as time permits.</p></td></tr></table> <h1>Gldapwrap - Usage</h1> <p>To use Gldapwrap, you need to make sure the Gldapwrap jar is in your classpath as well as the Spring LDAP jars (provided in the download). An easy way to do this is to to put the jars in <code>~/.groovy/lib/</code>.</p> <p>First thing you need to do is define a schema class. A schema class is just an ordinary POGO.</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> class MyLdapEntry { List objectclass String distinguisheName } </pre></td></tr></table> <p>That's all you need to do to define a schema.</p> <p>Next is to create a <code>GldapwrapTemplate</code> which is basically the details of the LDAP server you want to connect to.</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> import gldapwrap.GldapwrapTemplate def template = new GldapwrapTemplate( url: "ldap://example.com", base: "dc=example,dc=com", userDn: "cn=admin,dc=example,dc=com", password: "secret" ) </pre></td></tr></table> <p>Next you need to inject the template into your schema class.</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> import gldapwrap.GldapwrapInjector(MyLdapEntry, template) </pre></td></tr></table> <p>Now you can do searches.</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> List entries = MyLdapEntry.find() // Find all entries at base entries = MyLdapEntry.find( filter: "(objectclass=person)", searchScope: javax.naming.directory.SearchControls.SUBTREE_SCOPE ) // Find all people in the whole directory entries = MyLdapEntry.find( filter: "(objectclass=person)", searchScope: javax.naming.directory.SearchControls.SUBTREE_SCOPE base: "ou=People" countLimit: 50 ) // Find the first 50 people in the directory under the people OU </pre></td></tr></table> <p>See <a class="confluence-link unresolved" data-content-title="Gldapwrap - Searching" data-linked-resource-default-alias="Gldapwrap - Searching" href="#">Searching</a> for more detail about searching.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced