From 9310339cecbc0ad395d81e666d59eb16bb297f92 Mon Sep 17 00:00:00 2001 From: Ulrik Sandberg Date: Wed, 21 Jan 2009 21:35:06 +0000 Subject: [PATCH] Added first FAQ entry. --- src/site/fml/faq.fml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml index e7ce734b..d5bdc99f 100644 --- a/src/site/fml/faq.fml +++ b/src/site/fml/faq.fml @@ -1,6 +1,34 @@ + + Operational Attributes + + How do I remove an operational attribute 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). +

+

+ There are basically two ways to do this: +

+
    +
  1. 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(). +
  2. +
  3. Use LdapTemplate#modifyAttributes(Name, ModificationItem[]) directly, manually + building the ModificationItem array. +
  4. +
+
+
+