GitLab Mirror pushed to branch trunk at cms-community / hippo-jackrabbit

Commits:
cbbda6b9 by Claus Köll at 2016-12-29T08:23:59+00:00
JCR-4093

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1776384 
13f79535-47bb-0310-9956-ffa450edef68

- - - - -
abe36993 by Claus Köll at 2016-12-29T08:41:31+00:00
JCR-4093 IndexRule are meant to be applied based on both primaryType and minin 
type based inheritance. Currently it appears that only primaryType based 
inheritance is working

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1776385 
13f79535-47bb-0310-9956-ffa450edef68

- - - - -


3 changed files:

- 
jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
- 
jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
- + 
jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config5.xml


Changes:

=====================================
jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
=====================================
--- 
a/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
+++ 
b/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
@@ -792,6 +792,11 @@ public class IndexingConfigurationImpl
          *         <code>false</code> otherwise.
          */
         public boolean appliesTo(NodeState state) {
+            for (Name mixinName : state.getMixinTypeNames()){
+               if (nodeTypeName.equals(mixinName)){
+                       return true;
+               }
+               }               
             if (!nodeTypeName.equals(state.getNodeTypeName())) {
                 return false;
             }


=====================================
jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
=====================================
--- 
a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
+++ 
b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImplTest.java
@@ -49,6 +49,7 @@ public class IndexingConfigurationImplTest extends 
AbstractIndexingTest {
         super.setUp();
         Node n = testRootNode.addNode(nodeName1, ntUnstructured);
         n.addMixin(mixReferenceable);
+        n.addMixin(mixLockable);
         session.save();
         nState = (NodeState) 
getSearchIndex().getContext().getItemStateManager().getItemState(
                 new NodeId(n.getIdentifier()));
@@ -97,8 +98,13 @@ public class IndexingConfigurationImplTest extends 
AbstractIndexingTest {
         assertFalse(config.isIncludedInNodeScopeIndex(state, FOO));
     }
 
-    //----------------------------< internal 
>----------------------------------
+    public void testIndexRuleMixin() throws Exception{
+        IndexingConfiguration config = createConfig("config5");
+        assertFalse(config.isIndexed(nState, NameConstants.JCR_LOCKOWNER));
+        assertTrue(config.isIndexed(nState, NameConstants.JCR_LOCKISDEEP));
+    }
 
+    //----------------------------< internal 
>----------------------------------
     protected IndexingConfiguration createConfig(String name) throws Exception 
{
         IndexingConfiguration config = new IndexingConfigurationImpl();
         config.init(loadConfig(name), getSearchIndex().getContext(),


=====================================
jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config5.xml
=====================================
--- /dev/null
+++ 
b/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/query/lucene/indexing_config5.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<!DOCTYPE configuration SYSTEM 
"http://jackrabbit.apache.org/dtd/indexing-configuration-1.2.dtd";>
+<configuration xmlns:jcr="http://www.jcp.org/jcr/1.0";
+               xmlns:nt="http://www.jcp.org/jcr/nt/1.0";
+               xmlns:mix="http://www.jcp.org/jcr/mix/1.0";>
+
+    <index-rule nodeType="mix:lockable">
+        <property>jcr:lockIsDeep</property>
+    </index-rule>
+
+</configuration>
\ No newline at end of file



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-jackrabbit/compare/05fba655aede4b697f931d94661877270554505f...abe36993051a15dd7409b512f8eb563029e0ec0d
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to