The only thing that doesn't work are the <xsp:expr>
If I replace a value with a variable like :
...
<xsp:logic>
String MyTest = "(cn=tfrgh*)";
</xsp:logic>
...
<ldap:filter><xsp:expr>MyTest</xsp:expr></ldap:filter>
...
I get a "java.lang.NullPointerException" error :
java.lang.NullPointerException
at
org.apache.cocoon.webapps.authentication.components.Authenticator.authen
ticate(Authenticator.java:288)
at
org.apache.cocoon.webapps.authentication.components.DefaultAuthenticatio
nManager.login(DefaultAuthenticationManager.java:218)
at
org.apache.cocoon.webapps.authentication.acting.LoginAction.act(LoginAct
ion.java:118)
at
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(Ac
tTypeNode.java:133)
-----Original Message-----
From: Yury Mikhienko [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 7:23 AM
To: [EMAIL PROTECTED]
Subject: Re: LDAP Transformer with XSP page?
On Tue, 1 Jul 2003 16:20:59 +0200
<[EMAIL PROTECTED]> wrote:
> Is it possible to create the ldap.xml, with the ldap queries in a xsp
> page?
>
Yes, for example:
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:ldap="http://apache.org/cocoon/LDAP/1.0">
<page>
<xsp:logic>
String cn = request.getParameter("cn");
if(cn == null) cn = "*";
</xsp:logic>
<ldap:execute-query>
<ldap:initializer>com.sun.jndi.ldap.LdapCtxFactory</ldap:initializer>
<ldap:serverurl>ldap://ldaphost</ldap:serverurl>
<ldap:port>389</ldap:port>
<ldap:scope>OBJECTS_SCOPE</ldap:scope>
<ldap:rootdn>cn=Directory Manager</ldap:rootdn>
<ldap:password>password</ldap:password>
<ldap:searchbase>ou=people,o=company</ldap:searchbase>
<ldap:attribute>cn</ldap:attribute>
<ldap:attribute>sn</ldap:attribute>
<ldap:attribute>givenName</ldap:attribute>
<ldap:attribute>initials</ldap:attribute>
<ldap:attribute>mobile</ldap:attribute>
<ldap:attribute>mail</ldap:attribute>
<ldap:attribute>ou</ldap:attribute>
<ldap:attribute>uid</ldap:attribute>
<ldap:attribute>title</ldap:attribute>
<ldap:show-attribute>true</ldap:show-attribute>
<ldap:filter>(&(uid=<xsp:expr>cn</xsp:expr>)(mobile=*))</ldap:filter
>
</ldap:execute-query>
</page>
</xsp:page>
--
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]