Skip to content

Editing Docs #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java

jdk:
- oraclejdk8
- openjdk8

os:
- linux
Expand All @@ -17,4 +17,4 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

script: ./gradlew build
script: ./gradlew build
3 changes: 2 additions & 1 deletion src/docs/asciidoc/faq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

=== How do I remove an operational attribute by using `context.removeAttributeValue()`?

By default, the `DirContextAdapter` reads only the visible attributes. This is because the operational attributes are returned by the server only if explicitly asked for, and there is no way for Spring LDAP to know the attributes for which to ask. This means that the `DirContextAdapter` is not populated with the operational attributes. Consequently, the `removeAttributeValue` does not have any effect (since from the point of view of the `DirContextAdapter`, it was not there in the first place).
By default, the `DirContextAdapter` reads only the visible attributes. This is because the operational attributes are returned by the server only if explicitly asked for, and there is no way for Spring LDAP to know the attributes for which to ask. This means that the `DirContextAdapter` is not populated with the operational attributes. Consequently, the `removeAttributeValue` does not have any effect (since, from the point of view of the `DirContextAdapter`, it was not there in the first place).

There are basically two ways to do this:

* Use a search or lookup method that takes the attribute names as an argument, such as `LdapTemplate#lookup(Name, String[], ContextMapper)`. Then use a `ContextMapper` implementation that returns the supplied `DirContextAdapter` in `mapFromContext()`.

* Use `LdapTemplate#modifyAttributes(Name, ModificationItem[])` directly, manually building the `ModificationItem` array.
Loading