You are not logged in Log in Join
You are here: Home » Members » Jeffrey P Shell » ZopeLDAP 1.1.0 » ZopeLDAPWiki » UsingWithDTML

Log in
Name

Password

 
 

History for UsingWithDTML

??changed:
-
Notes on using LDAP Filter Methods with DTML

  These notes originate from some email asking *Hmm, yes, I can use the
  ZLDAP filter method with the test menu, but I couldn't find out how can
  I use it in dtml :-(. My filter method is just: cn=<dtml-var val>
  (val is the argument).  I tried in a dtml document something* like::

	<dtml-in expr="LDAPrech('lstep*')">
	 <dtml-var name="index">
	</dtml-in>

  *But I get an error (Error Type: Bad Request,Error Value: ['val'])*

  With any pseudo-methods (SQL Methods, LDAP Filter Methods), you have
  to pass in the arguments by keyword, for example:

	<dtml-in expr="LDAPrech(val = 'lstep*')">
	 <dtml-var name="index">
	</dtml-in>


  Naturally, all attributes are accessible.  For example:

	<dtml-in expr="LDAPrech(val = 'lstep*')">
	 Common name: <dtml-var name="cn">
	 Surname: <dtml-var name="sn">
	</dtml-in>

  All attributes are sequences that can print themselves as a
  comma-seperated string in DTML.  But you can also use &lt;dtml-in&gt;.  For
  example:

	<dtml-in name="ldapSearchGroups">
	 <dtml-var name="cn">
	 <dtml-in name="uniqueName">
	  <dtml-var name="sequence-item">
	 </dtml-in>
	</dtml-in>

  would loop over all the values on the "uniqueName" attribute.

  According to popular theory anyways :)