directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r109908 - in incubator/directory/eve/trunk: jndi-provider/src/java/org/apache/eve/jndi maven-eve-plugin/src/java/org/apache/eve/tools/schema protocol/src/java/org/apache/eve/protocol
Date Sun, 05 Dec 2004 19:54:57 GMT
Author: akarasulu
Date: Sun Dec  5 11:54:57 2004
New Revision: 109908

URL: http://svn.apache.org/viewcvs?view=rev&rev=109908
Log:
Changes ...

 o Fixed situation where '' was being used when description did not exist
   within plugin which require install uninstall to see effects
 o Fixed search issues with KMail which was actually a major bug that would 
   have produced problems later on anyway.


Modified:
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java
   incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
   incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java?view=diff&rev=109908&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java&r1=109907&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java&r2=109908
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveDirContext.java
Sun Dec  5 11:54:57 2004
@@ -509,33 +509,40 @@
         ExprNode filterNode = null;
         LdapName target = buildTarget( name );
 
-        try 
+        if ( filter == null && getEnvironment().containsKey( "__filter__" ) )
         {
-            /*
-             * TODO Added this parser initialization code to the FilterImpl
-             * and have a static class parser that can be globally accessed. 
-             */
-            FilterParser parser = new FilterParserImpl();
-            filterNode = parser.parse( filter );
+            filterNode = ( ExprNode ) getEnvironment().get( "__filter__" );
         }
-        catch ( ParseException pe )
+        else
         {
-            InvalidSearchFilterException isfe =
-                new InvalidSearchFilterException (
-                "Encountered parse exception while parsing the filter: '" 
-                + filter + "'" );
-            isfe.setRootCause( pe );
-            throw isfe;
+            try
+            {
+                /*
+                 * TODO Added this parser initialization code to the FilterImpl
+                 * and have a static class parser that can be globally accessed.
+                 */
+                FilterParser parser = new FilterParserImpl();
+                filterNode = parser.parse( filter );
+            }
+            catch ( ParseException pe )
+            {
+                InvalidSearchFilterException isfe =
+                    new InvalidSearchFilterException (
+                    "Encountered parse exception while parsing the filter: '"
+                    + filter + "'" );
+                isfe.setRootCause( pe );
+                throw isfe;
+            }
+            catch ( IOException ioe )
+            {
+                NamingException ne = new NamingException(
+                    "Parser failed with IO exception on filter: '"
+                    + filter + "'" );
+                ne.setRootCause( ioe );
+                throw ne;
+            }
         }
-        catch ( IOException ioe )
-        {
-            NamingException ne = new NamingException(
-                "Parser failed with IO exception on filter: '" 
-                + filter + "'" );
-            ne.setRootCause( ioe );
-            throw ne;
-        }
-        
+
         return getNexusProxy().search( target , getEnvironment(), filterNode, cons );
     }
 

Modified: incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template?view=diff&rev=109908&p1=incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template&r1=109907&p2=incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template&r2=109908
==============================================================================
--- incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
(original)
+++ incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
Sun Dec  5 11:54:57 2004
@@ -64,7 +64,9 @@
 
         objectClass = newObjectClass( "$objectClass.getOid()", registries );
         objectClass.setObsolete( $objectClass.isObsolete() );
-        objectClass.setDescription( "$!objectClass.getDescription()" );
+        #if ( $objectClass.getDescription() )
+        objectClass.setDescription( "$objectClass.getDescription()" );
+        #end
         #if ( $objectClass.getObjectClassType().getName() == "ABSTRACT" )
         objectClass.setType( ObjectClassTypeEnum.ABSTRACT );
         #elseif ( $objectClass.getObjectClassType().getName() == "AUXILIARY" )

Modified: incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java?view=diff&rev=109908&p1=incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java&r1=109907&p2=incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java&r2=109908
==============================================================================
--- incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java
(original)
+++ incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/SearchHandler.java
Sun Dec  5 11:54:57 2004
@@ -88,7 +88,27 @@
                     .getInitialLdapContext( key, null, true );
             ctx = ( LdapContext ) ictx.lookup( "" );
             ctx.addToEnvironment( DEREFALIASES_KEY, req.getDerefAliases().getName() );
-            list = ctx.search( req.getBase(), req.getFilter().toString(), controls );
+
+            /*
+             * Eve JNDI Provider Specific Hack!
+             *
+             * Hack to get around not having to generate the filter string and
+             * reparse the expression back into a tree: instead we sneak the
+             * filter into the environment so the Eve context implementation
+             * can pick it up.
+             *
+             * @todo change this so we test for the Eve provider to use the hack
+             * @todo find better way to do this
+             * @todo if provider is not Eve provider then we need to generate filter
+             *
+             * To generate we're going to need a visitor for this.  Can't use the
+             * toString() method which uses scan counts and is for pretty printing
+             * the filter.
+             */
+            ctx.addToEnvironment( "__filter__", req.getFilter() );
+            list = ctx.search( req.getBase(), null, controls );
+            ctx.removeFromEnvironment( "__filter__" );
+
             if ( list.hasMore() )
             {
                 return new SearchResponseIterator( req, list );
@@ -100,7 +120,7 @@
                 resp.setLdapResult( new LdapResultImpl( resp ) );
                 resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
                 resp.getLdapResult().setMatchedDn( req.getBase() );
-                return Collections.singleton( resp ).iterator();        
+                return Collections.singleton( resp ).iterator();
             }
         }
         catch ( NamingException e )

Mime
View raw message