cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael French <mfre...@zycor.lgc.com>
Subject RE: LDAP woes
Date Thu, 23 Mar 2000 17:45:05 GMT

One issue I ran into as I upgraded to Xerces was that 
the semantics of getAttribute(name) changed.
If name is null or does not exist, then the return value
is an empty String, not a null String (DOM1 -> DOM2 ?)
So all the tests that look like this:

      if (value == null) ...

need to be changed to

      if (value == null || value.equals("")) ...

or the equivalent.

Examples include many places in LdapDefs.java, such as: 

	public Properties getQueryProperties(
        String name ) 
        throws Exception 
      {
-       if (name == null) return default_query_props;
+       if (name == null || name.equals("")) return default_query_props;
        Properties props = (Properties)query_props.get(name);
        return props;
      }

Mike


> -----Original Message-----
> From: Ian Abbott [mailto:iana@cinesite.co.uk]
> Sent: Thursday, March 23, 2000 10:45 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: LDAP woes
> 
> 
> Autobahn Internet Services wrote:
> > 
> > I've been really happy with cocoon so far (once I got Tomcat set up
> > to work with it). The only thing I'm still tearing my hair out about
> > is getting it to work with LDAP (RH6.1, latest Cocoon, Apache 1.3.9,
> > latest OpenLDAP server). The server's there and responds to command
> > line and JNDI requests. But somehow I keep getting this NullPointer
> > exception:
> > 
> 
> I kept getting this too, and I tried all manner of things including
> shaking a dead chicken over the machine to get it to work. In the end,
> after many attempts, I got it working. Now, I'm not sure if this is
> because I recompiled Cocoon myself from a tarball on
> http://xml.apache.org/from-cvs/, or whether I finally sorted out the
> LDAP.XML file, though I'm sure recompilation wouldn't have any real
> effect.
> 
> The problem seems to be conflicting information in the 
> documentation and
> the sample. I think the placement of searchbase is the most important
> factor.
> 
> Anyway, here's the file that worked for me, running on Apache 1.3.12,
> OpenLDAP, JServ 1.1, Cocoon 1.7.1-dev and SGI IRIX 6.5.7:
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="phonebook.xsl"?>
> <?cocoon-process type="ldap"?>
> <?cocoon-process type="xslt"?>
> 
> <page>
> 
>  <ldap-defs>
>   <ldap-server name="cinesite">
>    <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
>    <ldap-serverurl>ldap://LDAP.FQDN.GOES.HERE</ldap-serverurl>
>   </ldap-server>
>   <ldap-querydefs name="standard" default="yes"/>
>  </ldap-defs>
> 
>  <ldap-query server="cinesite" ldap-searchbase="o=Cinesite,c=UK"
> defs="standard">
>    cn=*{@name}*
>  </ldap-query>
> 
> </page>
> 
> I'll spare you the XSL sheet. Safe to say that calling
> phonebook.xml?name=ia finds things fairly well. 
> 
> I knocked up a reasonable GUI to all of this and showed it to a
> colleague, and all the while went 'and not a bit of code was 
> needed!'. 
> 
> Thanks to all concerned. Cocoon is definitely making my life more
> interesting.
> 
> Cheers
> Ian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Mime
View raw message