<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 14, 2015 at 8:01 PM, Robert A Basch <span dir="ltr"><<a href="mailto:rbasch@mit.edu" target="_blank">rbasch@mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In our version 2 attribute-resolver.xml, we have been using the<br>
template language to effect a conditional query in an additional LDAP<br>
data connector, based on the value (if any) of a dependency attribute:<br>
<br>
<FilterTemplate><br>
<![CDATA[<br>
#if (${attribute.isEmpty()} || ! ${attribute.get(0)})<br>
<dummy filter guaranteed to return no results><br>
#else<br>
<"real" LDAP search filter><br>
#end<br>
]]><br>
</FilterTemplate><br></blockquote><div><br></div><div>I believe JNDI strips spaces internally from the beginning and end of a filter, but it doesn't strip other forms of whitespace. So the following template would works as well:</div>
<br> <FilterTemplate><br> <![CDATA[<br> #if (${attribute.isEmpty()} || ! ${attribute.get(0)})<br> <dummy filter guaranteed to return no results>#else<br> <"real" LDAP search filter>#end<br> ]]><br> </FilterTemplate><div><br></div><div>--Daniel Fisher</div><div><br></div></div></div></div>