Editing pass
I edited for spelling, punctuation, grammar, usage, and corporate voice. I also added some links, both internal and external.
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
|
||||
== Operational Attributes
|
||||
|
||||
=== How do I remove an operational attribute using context.removeAttributeValue()?
|
||||
=== How do I remove an operational attribute by using `context.removeAttributeValue()`?
|
||||
|
||||
The `DirContextAdapter` will only read the visible attributes per default. This is because the operational attributes will only be returned by the server if explicitly asked for, and there is no way for Spring LDAP to know what attributes to ask for. This means that the `DirContextAdapter` will not be populated with the operational attributes, and hence the `removeAttributeValue` will not have any effect (since from the `DirContextAdapter`'s point of view, it wasn't 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 argument, like `LdapTemplate#lookup(Name, String[], ContextMapper)`. Use a `ContextMapper` implementation that just returns the supplied `DirContextAdapter` in `mapFromContext()`.
|
||||
|
||||
* Use `LdapTemplate#modifyAttributes(Name, ModificationItem[])` directly, manually building the `ModificationItem` array.
|
||||
* 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.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user