Here is my problem more clearly :
We are two developpers, we both develop an application with cocoon. I
use XSP and the other use XML-Forms. He builded a portal. I created an
application that has to be integrated into this portal. To help him in
his work, I have to change his authentification source (actually he use
an XML file to authentificate) to our Active Directory server. So I have
to add it into the portal and into my XSP pages (because I need to get
the user name/role/group).
I don't know anything about how XML forms work, but I know XSP.

Now, is there an easy way, to change the authentification source from an
XML file to Active Directory, and is there an easy way to get the
username in a XSP page.

At this time I have the LDAPTransformer well configured in my sitemap,
but nothing more.

Thank you for you help!


-----Original Message-----
From: Yury Mikhienko [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 04, 2003 5:03 PM
To: [EMAIL PROTECTED]
Subject: Re: XSP & LDAP -> The tags aren't interpreted




> I use cocoon 2.0
> the output on the explorer is :
>
ldap://ldap.innosoft.com(&(objectclass=pet)(cn=B*))ou=Pets,dc=Innosoft,d
> c=comonetrue10owner,givenname,descriptionfalse
> 

In all  versions of cocoon (2.0,2.0.3,4 ) in LDAPTransformer the
following DTD is used.
<snip>
* The following DTD is valid:<br>
 * &lt;!ELEMENT execute-query (attribute+ | show-attribute? | scope? |
initializer? | authentication? | error-element? | sax-error?
doc-element? | row-element? | version? | serverurl? | rootdn? |
password? | deref-link? | count-limit? | searchbase, filter)&gt;<br>
 * &lt;!ELEMENT execute-increment (attribute | show-attribute? | scope?
| initializer? | authentication? | error-element? | sax-error? |
doc-element? | row-element? | version? | serverurl? | rootdn? |
password? | deref-link? | count-limit? | searchbase, filter)&gt;<br>
 * increments (+1) an integer attribute on a directory-server (ldap)<br>
 * <br>
 * &lt;!ELEMENT initializer (#PCDATA)&gt;+ (default:
"com.sun.jndi.ldap.LdapCtxFactory")<br>
 * &lt;!ELEMENT authentication (#PCDATA)&gt;+ (default: "simple")<br>
 * &lt;!ELEMENT version (#PCDATA)&gt;+ (default: "2")<br>
 * &lt;!ELEMENT serverurl (#PCDATA)&gt;+<br>
 * &lt;!ELEMENT port (#PCDATA)&gt;+ (default: 389)<br>
 * &lt;!ELEMENT rootdn (#PCDATA)&gt;+<br>
 * &lt;!ELEMENT password (#PCDATA)&gt;+<br>
 * &lt;!ELEMENT scope (ONELEVEL_SCOPE | SUBTREE_SCOPE |
OBJECT_SCOPE)&gt;+ (default: ONELEVEL_SCOPE)<br>
 * &lt;!ELEMENT searchbase (#PCDATA)&gt;+<br>
 * &lt;!ELEMENT doc-element (#PCDATA)&gt;+ (default: "doc-element")<br>
 * &lt;!ELEMENT row-element (#PCDATA)&gt;+ (default: "row-element")<br>
 * &lt;!ELEMENT error-element (#PCDATA)&gt;+ (default: "ldap-error") (in
case of error returned error tag)<br>
 * &lt;!ELEMENT sax_error (TRUE  | FALSE)&gt+; (default: FALSE) (throws
SAX-Exception instead of error tag)<br>
 * &lt;!ELEMENT attribute (#PCDATA)&gt;<br>
 * &lt;!ELEMENT show-attribute (TRUE | FALSE)&gt; (default: TRUE)<br>
 * &lt;!ELEMENT filter (#PCDATA | execute-query)&gt;<br>
 * &lt;!ELEMENT deref-link (TRUE | FALSE)&gt; (default: FALSE)<br>
 * &lt;!ELEMENT count-limit (#PCDATA)&gt; (integer default: 0 -&gt; no
limit)<br>
 * &lt;!ELEMENT time-limit (#PCDATA)&gt; (integer default: 0 -&gt;
infinite)<br>
 * &lt;!ELEMENT debug (TRUE  | FALSE)&gt+; (default: FALSE)<br>
 * <br>
 * + can also be defined as parameter in the sitemap.
 * <br>
 * <br>
 *
 * @author Felix Knecht
 * @version CVS $Id: LDAPTransformer.java,v 1.6 2002/02/22 07:03:56
cziegeler Exp $
 */

</snip>
and the following namespace: http://apache.org/cocoon/LDAP/1.0

But what are you using?
simple real example:

     <ldap:execute-query>
 
<ldap:initializer>com.sun.jndi.ldap.LdapCtxFactory</ldap:initializer>
      <ldap:serverurl>ldap://ldap.my.host</ldap:serverurl>
      <ldap:port>389</ldap:port>
      <ldap:scope>OBJECTS_SCOPE</ldap:scope>
      <ldap:rootdn>cn=DN</ldap:rootdn>
      <ldap:password>password</ldap:password>
      <ldap:searchbase>ou=people,o=company</ldap:searchbase>
      <ldap:attribute>urls</ldap:attribute>
      <ldap:attribute>title</ldap:attribute>
      <ldap:attribute>mobile</ldap:attribute>
      <ldap:attribute>cn</ldap:attribute>
      <ldap:attribute>sn</ldap:attribute>
      <ldap:attribute>zone</ldap:attribute>
      <ldap:attribute>sleep</ldap:attribute>
      <ldap:attribute>trace</ldap:attribute>
      <ldap:attribute>admin</ldap:attribute>
      <ldap:show-attribute>true</ldap:show-attribute>
      <ldap:filter>(&amp;(uid=testuser))</ldap:filter>
     </ldap:execute-query>


> 
> No.
> Can you send me the output of work?
> And what the version of cocoon you use?
> 
> > doesn't work. Is there anything to add in the cocoon.xconf maybe?
> > 
> > 
> > Try the following:
> > <?xml version="1.0" encoding="KOI8-R"?>
> > <xsp:page
> >   language="java"
> >   xmlns:xsp="http://apache.org/xsp";
> >   xmlns:ldap="http://apache.org/cocoon/LDAP/1.0";>
> > 
> > instead of
> > <xsp:page language="java"
> >   xmlns:ldap="http://www.apache.org/2000/LDAP";
> >   xmlns:xsp="http://apache.org/xsp";
> >   xmlns:session="http://apache.org/xsp/session/2.0"; 
> >   xmlns:esql="http://apache.org/cocoon/SQL/v2"; 
> >   xmlns:xsp-request="http://apache.org/xsp/request/2.0";
> > 
> > 
> > > Yes, that works. now, how can I use it? When I use it like :
> > >     <map:pipeline>
> > >       <map:match pattern="testldap">
> > >         <map:generate type="serverpages"
> > > src="workflowmanager/documents/{1}.xsp"/>
> > >         <map:transform type="ldap"/>
> > >         <map:serialize/>
> > >       </map:match>
> > >     </map:pipeline> 
> > > and in the xsp page I write this sample page (from the apache
site).
> > And
> > > then I just get text as result. The tags aren't interpreted.
> > > 
> > > <xsp:page language="java"
> > >  xmlns:ldap="http://www.apache.org/2000/LDAP";
> > >  xmlns:xsp="http://apache.org/xsp";
> > >  xmlns:session="http://apache.org/xsp/session/2.0"; 
> > >  xmlns:esql="http://apache.org/cocoon/SQL/v2"; 
> > >  xmlns:xsp-request="http://apache.org/xsp/request/2.0";
> > > >
> > > 
> > > 
> > > <page>
> > >   <ldap:execute-query>
> > >     <ldap:server-url>ldap://ldap.innosoft.com</ldap:server-url>
> > >     <ldap:query>(&amp;(objectclass=pet)(cn=B*))</ldap:query>
> > >
<ldap:search-base>ou=Pets,dc=Innosoft,dc=com</ldap:search-base>
> > > 
> > >     <ldap:scope>one</ldap:scope>
> > >     <ldap:deref-link>true</ldap:deref-link>
> > >     <ldap:count-limit>10</ldap:count-limit>
> > >     <ldap:attributes>owner,givenname,description</ldap:attributes>
> > >     <ldap:relative-dn>false</ldap:relative-dn>
> > >   </ldap:execute-query>
> > > </page>
> > > </xsp:page>
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: Yury Mikhienko [mailto:[EMAIL PROTECTED] 
> > > Sent: Wednesday, June 04, 2003 2:39 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: XSP & LDAP
> > > 
> > > 
> > > Put the jndi.jar into the $COCOON_SRC_DIR/lib/optional
> > > Check the $COCOON_SRC_DIR/lib/jars.xml
> > > for following lines:
> > >  <file>
> > >   <title>jndi LDAP API</title>
> > >   <description>Java API for LDAP works</description>
> > >   <used-by>LDAP Transformer</used-by>
> > >   <lib>optional/jndi.jar</lib>
> > >   <homepage>http://java.sun.com/products/jndi</homepage>
> > >  </file>
> > > 
> > > and rebuild the cocoon.
> > > 
> > > After rebuilding, in the
> > >
> $COCOON_SRC_DIR/build/cocoon/classes/org/apache/cocoon/transformation
> > > you find the LDAPTransformer.class and
> LDAPTransformer$LDAPQuery.class
> > > 
> > > > there aren't in the cocoon.jar
(org/apache/cocoon/transformation)
> > > > Should I add them? Where can I find them?
> > > > 
> > > > Check the :
> > > > LDAPTransformer.class
> > > > LDAPTransformer$LDAPQuery.class
> > > > in the your cocoon.jar (org/apache/cocoon/transformation)
> > > > 
> > > > > I have them, into the cocoon/web-inf/lib I have these libs :
> > > > > jndi.jar
> > > > > jaas.jar
> > > > > ldap.jar
> > > > > ldapbp.jar
> > > > > ldapsec.jar
> > > > > providerutil.jar
> > > > > 
> > > > > but I doesn't work. Still have the "class not found" error
> > > > > 
> > > > > > When I declare the transformer 
> > > > > > <map:transformer name="ldap"
> > > > > > src="org.apache.cocoon.transformation.LDAPTransformer"/>
> > > > > > in the sitemap I get the error "class not found".
> > > > > > Do I need some special libs? 
> > > > > 
> 
> 
> 
> -- 
>  
> Best regards,
> Yury Mikhienko.
> IT engineer, ZAO "Mobicom-Kavkaz"
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
 
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]

Reply via email to