jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r898056 - in /jackrabbit/branches/2.0: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/test/resources/org/apache/jackrabbit...
Date Mon, 11 Jan 2010 20:31:27 GMT
Author: mreutegg
Date: Mon Jan 11 20:31:26 2010
New Revision: 898056

URL: http://svn.apache.org/viewvc?rev=898056&view=rev
Log:
JCR-2458: Allow basic regexp in namespace prefix of index-rule

Added:
    jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
      - copied unchanged from r898042, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
    jackrabbit/branches/2.0/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/
      - copied from r898042, jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/
    jackrabbit/branches/2.0/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config1.xml
      - copied unchanged from r898042, jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config1.xml
    jackrabbit/branches/2.0/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config2.xml
      - copied unchanged from r898042, jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config2.xml
    jackrabbit/branches/2.0/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config3.xml
      - copied unchanged from r898042, jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config3.xml
Modified:
    jackrabbit/branches/2.0/   (props changed)
    jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
    jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java

Propchange: jackrabbit/branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 11 20:31:26 2010
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:891595,891629,892253,892263,894150-894151,896408,896513,896532,896857,896870,896876,896908,896940,896942-896943,896969,896977,897071,897836,897842,897858,897935
+/jackrabbit/trunk:891595,891629,892253,892263,894150-894151,896408,896513,896532,896857,896870,896876,896908,896940,896942-896943,896969,896977,897071,897836,897842,897858,897935,898042

Modified: jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java?rev=898056&r1=898055&r2=898056&view=diff
==============================================================================
--- jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
(original)
+++ jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
Mon Jan 11 20:31:26 2010
@@ -16,51 +16,52 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
-import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver;
-import org.apache.jackrabbit.core.state.ItemStateManager;
-import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.ItemStateException;
-import org.apache.jackrabbit.core.state.PropertyState;
-import org.apache.jackrabbit.core.state.ChildNodeEntry;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+
+import org.apache.commons.collections.iterators.AbstractIteratorDecorator;
 import org.apache.jackrabbit.core.HierarchyManager;
-import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.HierarchyManagerImpl;
-import org.apache.jackrabbit.core.nodetype.xml.AdditionalNamespaceResolver;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.xml.AdditionalNamespaceResolver;
 import org.apache.jackrabbit.core.query.QueryHandlerContext;
+import org.apache.jackrabbit.core.state.ChildNodeEntry;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.ItemStateManager;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
-import org.apache.jackrabbit.spi.commons.name.Pattern;
-import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.util.ISO9075;
+import org.apache.jackrabbit.spi.PathFactory;
+import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
+import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
+import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver;
+import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
+import org.apache.jackrabbit.spi.commons.name.Pattern;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
+import org.apache.jackrabbit.util.ISO9075;
 import org.apache.lucene.analysis.Analyzer;
-import org.apache.commons.collections.iterators.AbstractIteratorDecorator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
 import org.w3c.dom.CharacterData;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.NamespaceException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Collections;
-import java.util.NoSuchElementException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Properties;
 
 /**
  * <code>IndexingConfigurationImpl</code> implements a concrete indexing
@@ -565,8 +566,15 @@
             String localPattern = pattern;
             int idx = pattern.indexOf(':');
             if (idx != -1) {
-                // use a dummy local name to get namespace uri
-                uri = resolver.getQName(pattern.substring(0, idx) + ":a").getNamespaceURI();
+                String prefix = pattern.substring(0, idx);
+                if (prefix.equals(".*")) {
+                    // match all namespaces
+                    uri = prefix;
+                } else {
+                    // match only single namespace
+                    // use a dummy local name to get namespace uri
+                    uri = resolver.getQName(prefix + ":a").getNamespaceURI();
+                }
                 localPattern = pattern.substring(idx + 1);
             }
             this.pattern = Pattern.name(uri, localPattern);

Modified: jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java?rev=898056&r1=898055&r2=898056&view=diff
==============================================================================
--- jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
(original)
+++ jackrabbit/branches/2.0/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
Mon Jan 11 20:31:26 2010
@@ -41,6 +41,7 @@
         suite.addTestSuite(IndexingAggregateTest.class);
         suite.addTestSuite(IndexMigrationTest.class);
         suite.addTestSuite(ChainedTermEnumTest.class);
+        suite.addTestSuite(IndexingConfigurationImplTest.class);
 
         return suite;
     }



Mime
View raw message