Hello,
at the snipplets or http://wiki.cocoondev.org/Wiki.jsp?page=LDAP

your xsp has to generate xml code that looks like the example query code.

Example: (hope this helps)
Martin

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java" 
        xmlns:xsp="http://apache.org/xsp"; 
        xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
   <xsp:structure>
      <xsp:include>java.lang.String</xsp:include>     
   </xsp:structure>
<LDAPSEARCH>
   <xsp:logic>  
        String loopString = null;
        String typeString = null;
        loopString = request.getParameter("loop");
        typeString = request.getParameter("type");
        int loop = 0;

        if (typeString.equals("xml")) 
        {
          if (loopString != null) 
          {
            loop = Integer.parseInt(loopString);
            // wenn Loopangabe, mindere Eingabe um 1
            loop = loop - 1;
          }
          else 
          { 
            // wenn keine Loopangabe, setze Schleife auf 0 zus�tzliche Durchl�ufe
            loop = 0;
          }
        }
        else if (typeString.equals("html"))
        {
          // wenn HTML; setze Schleife auf 1 zus�tzlichen Durchlauf
          loop = 1;
        }
        else
        { }

   </xsp:logic> 
   <LOOP><xsp:expr>loop</xsp:expr></LOOP>
   
   <STRING><xsp-request:get-query-string/></STRING>

   <ldap:execute-query xmlns:ldap="http://apache.org/cocoon/LDAP/1.0";>
      <ldap:initializer>com.sun.jndi.ldap.LdapCtxFactory</ldap:initializer>

      <ldap:authentication>simple</ldap:authentication>

      <ldap:version>3</ldap:version>

      <ldap:serverurl>ldap://service1.intra.test.de</ldap:serverurl>

      <ldap:port>389</ldap:port>

      <ldap:scope>SUBTREE_SCOPE</ldap:scope>

      <ldap:rootdn>cn=me,ou=IS,o=test</ldap:rootdn>

      <ldap:password>xxxxxxxxxx</ldap:password>

      <ldap:debug>FALSE</ldap:debug>

      <ldap:deref-link>TRUE</ldap:deref-link>

      <ldap:count-limit>0</ldap:count-limit>

      <ldap:time-limit>0</ldap:time-limit>

      <xsp:logic>

        String search = request.getParameter("search");
            
        if (("cn").equals(search))
        {

      </xsp:logic>

      <ldap:filter>(| <xsp:logic>
        String[] dn; 
        dn = new String[request.getParameterValues("dn").length]; 
        for (int i=0; i&lt;request.getParameterValues("dn").length; i++) 
        { 
          try 
          { 
            dn[i] = new String(request.getParameterValues("dn")[i]); 
            dn[i] = "("+dn[i].substring(0,dn[i].indexOf(","))+")";
            </xsp:logic><xsp:expr>dn[i]</xsp:expr><xsp:logic>
          } 
          catch (IllegalArgumentException _e) 
          {} 
        }

      </xsp:logic> )</ldap:filter>
      
      <xsp:logic>
        }
        else if (("dn").equals(search))
        {
      </xsp:logic>        
      
      <ldap:filter>(| (cn=*))</ldap:filter>
      
      <ldap:searchbase><xsp-request:get-parameter name="dn" default="" 
/></ldap:searchbase>
      <xsp:logic>
        }
        else 
        {}
      </xsp:logic>
      
      <ldap:show-attribute>TRUE</ldap:show-attribute>

      <ldap:doc-element>LDAP</ldap:doc-element>

      <ldap:row-element>LDAPSET</ldap:row-element>

      <ldap:error-element>ELEMENT</ldap:error-element>

      <ldap:attribute>CN</ldap:attribute>

      <ldap:attribute>DN</ldap:attribute>

      <ldap:attribute>OU</ldap:attribute>

      <ldap:attribute>SN</ldap:attribute>

      <ldap:attribute>EMPLOYEEID</ldap:attribute>

      <ldap:attribute>TELEPHONENUMBER</ldap:attribute>

      <ldap:attribute>ASSISTANT</ldap:attribute>

      <ldap:attribute>MANAGER</ldap:attribute>
      
      <ldap:attribute>DIRECTREPORTS</ldap:attribute>

      <ldap:attribute>ORGCHARTPARENTDN</ldap:attribute>

      <ldap:attribute>FULLNAME</ldap:attribute>

      <ldap:attribute>GIVENNAME</ldap:attribute>

   </ldap:execute-query>
</LDAPSEARCH>
</xsp:page>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to