This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git
commit 6153de41ac6dea87c21dadc16d89e43387c2ac22 Author: Robert Munteanu <[email protected]> AuthorDate: Mon Mar 14 17:27:52 2022 +0100 SLING-11134 - Extract Oak index definitions and package them as an additional file Support non-root index definitions. --- .../handlers/IndexDefinitionsEntryHandler.java | 11 ++- .../cpconverter/index/IndexDefinitions.java | 27 ++++++- .../index/IndexDefinitionsJsonWriter.java | 7 +- .../ContentPackage2FeatureModelConverterTest.java | 1 + .../handlers/IndexDefinitionsEntryHandlerTest.java | 65 +++++++++++++--- .../index_non_root_path/META-INF/vault/config.xml | 86 ++++++++++++++++++++++ .../META-INF/vault/definition/.content.xml | 37 ++++++++++ .../index_non_root_path/META-INF/vault/filter.xml | 20 +++++ .../META-INF/vault/properties.xml | 34 +++++++++ .../index_non_root_path/jcr_root/.content.xml | 21 ++++++ .../jcr_root/content/.content.xml | 28 +++++++ .../jcr_root/content/_oak_index/.content.xml | 65 ++++++++++++++++ 12 files changed, 385 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java b/src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java index b0770f8..a684cb1 100644 --- a/src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java +++ b/src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java @@ -47,6 +47,13 @@ import org.xml.sax.InputSource; */ public class IndexDefinitionsEntryHandler extends AbstractRegexEntryHandler { + private static final String PATH_PATTERN = "" + + "/jcr_root/" + // jcr_root dir + "(.*/)?" + // optional path segment + PlatformNameFormat.getPlatformName(IndexDefinitions.OAK_INDEX_NAME) + + "(.*/)?" + // additional path segments + "/.*xml"; // only xml files + private final class IndexDefinitionsParserHandler implements DocViewParserHandler { private final WorkspaceFilter filter; private IndexDefinitions definitions; @@ -61,7 +68,7 @@ public class IndexDefinitionsEntryHandler extends AbstractRegexEntryHandler { @NotNull Optional<DocViewNode2> parentDocViewNode, int line, int column) throws IOException, RepositoryException { - if ( nodePath.startsWith(IndexDefinitions.OAK_INDEX_PATH) && filter.contains(nodePath) ) { + if ( nodePath.contains(IndexDefinitions.OAK_INDEX_PATH) && filter.contains(nodePath) ) { definitions.addNode(Text.getRelativeParent(nodePath, 1), docViewNode); } } @@ -80,7 +87,7 @@ public class IndexDefinitionsEntryHandler extends AbstractRegexEntryHandler { } public IndexDefinitionsEntryHandler() { - super("/jcr_root/" + PlatformNameFormat.getPlatformName(IndexDefinitions.OAK_INDEX_NAME)+ "/.*(/)?/*.xml"); + super(PATH_PATTERN); } @Override diff --git a/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitions.java b/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitions.java index 300e42c..9e32cc9 100644 --- a/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitions.java +++ b/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitions.java @@ -26,6 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; import org.apache.commons.io.IOUtils; import org.apache.jackrabbit.spi.Name; @@ -35,6 +36,12 @@ import org.jetbrains.annotations.NotNull; /** * Holds information about discovered index definitions * + * <p>According to the Oak documentation, indexes are located under a root <tt>/oak:index</tt>, or (lucene indexes only) + * under arbitrary repository locations, as long as they have an <tt>oak:index</tt> parent node.</p> + * + * <p>This class supports non-root indexes but does not attempt to enforce Oak-level invariants, such as which index + * types support non-root locations.</p> + * */ public class IndexDefinitions { @@ -72,15 +79,29 @@ public class IndexDefinitions { currentChildren.add(node); } - public @NotNull List<DocViewNode2> getIndexes() { - return getChildren(OAK_INDEX_PATH); + /** + * Returns the discovered index definitions by location + * + * <p>The returned map has the index parent location as keys and the index definitions as values, for instance:</p> + * + * <pre> + * /oak:index -> [counter, uuid] + * /content/oak:index -> [lucene-2] + * </pre> + * + * + * @return a map of discovered index locations, possibly empty + */ + public @NotNull Map<String, List<DocViewNode2>> getIndexes() { + return children.entrySet().stream() + .filter( e -> e.getKey().endsWith(OAK_INDEX_PATH) ) + .collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue) ); } public @NotNull List<DocViewNode2> getChildren(@NotNull String parentPath) { return children.getOrDefault(parentPath, Collections.emptyList()); } - /** * Returns a name in compact format * diff --git a/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitionsJsonWriter.java b/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitionsJsonWriter.java index a14fab5..2c8c106 100644 --- a/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitionsJsonWriter.java +++ b/src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitionsJsonWriter.java @@ -20,6 +20,7 @@ import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.function.Function; @@ -63,9 +64,9 @@ public class IndexDefinitionsJsonWriter { public void writeAsJson(@NotNull OutputStream out) { try ( JsonGenerator root = Json.createGenerator(out) ) { root.writeStartObject(); - for ( DocViewNode2 index : indexDefinitions.getIndexes() ) { - write(root, index, IndexDefinitions.OAK_INDEX_PATH); - } + for ( Map.Entry<String, List<DocViewNode2>> indexEntry : indexDefinitions.getIndexes().entrySet() ) + for ( DocViewNode2 index : indexEntry.getValue() ) + write(root, index, indexEntry.getKey()); root.writeEnd(); // end object declaration } } diff --git a/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java b/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java index f4e0441..940c780 100644 --- a/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java +++ b/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java @@ -487,6 +487,7 @@ public class ContentPackage2FeatureModelConverterTest extends AbstractConverterT converter.setFeaturesManager(new DefaultFeaturesManager(true, 5, outputDirectory, null, null, new HashMap<>(), aclManager)) .setBundlesDeployer(new SimpleFolderArtifactsDeployer(outputDirectory)) .setEmitter(DefaultPackagesEventsEmitter.open(outputDirectory)) + .setIndexManager(new DefaultIndexManager()) .convert(packageFile); } finally { verify(aclManager, times(1)).addPrivilegeDefinitions(any(PrivilegeDefinitions.class)); diff --git a/src/test/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandlerTest.java b/src/test/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandlerTest.java index 6bf7c55..1cdfff6 100644 --- a/src/test/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandlerTest.java +++ b/src/test/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandlerTest.java @@ -20,7 +20,9 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.ByteArrayInputStream; import java.io.IOException; +import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Objects; import javax.jcr.NamespaceRegistry; @@ -52,10 +54,13 @@ public class IndexDefinitionsEntryHandlerTest { public void matches() { IndexDefinitionsEntryHandler handler = new IndexDefinitionsEntryHandler(); assertThat(handler.matches("/jcr_root/_oak_index/.content.xml")).isTrue(); + assertThat(handler.matches("/jcr_root/not_oak_index/.content.xml")).isFalse(); assertThat(handler.matches("/jcr_root/_oak_index/bar/.content.xml")).isTrue(); assertThat(handler.matches("/jcr_root/_oak_index/lucene/tika/config.xml")).isTrue(); assertThat(handler.matches("/jcr_root/_oak_index/.vlt")).isFalse(); - assertThat(handler.matches("/jcr_root/apps/_oak_index/.content.xml")).isFalse(); + assertThat(handler.matches("/jcr_root/apps/_oak_index/.content.xml")).isTrue(); + assertThat(handler.matches("/jcr_root/apps/.content.xml")).isFalse(); + assertThat(handler.matches("/jcr_root/not_oak_index/.content.xml")).isFalse(); } @Test @@ -66,14 +71,18 @@ public class IndexDefinitionsEntryHandlerTest { traverseForIndexing(manager, "index_single_file"); IndexDefinitions defs = manager.getIndexes(); - List<DocViewNode2> indexes = defs.getIndexes(); + Map<String, List<DocViewNode2>> indexes = defs.getIndexes(); assertThat(indexes).as("index definitions") .hasSize(1) + .containsKey("/oak:index"); + + List<DocViewNode2> rootIndexes = indexes.get("/oak:index"); + assertThat(rootIndexes).as("root oak indexes") + .hasSize(1) .element(0) .has( Conditions.localName("foo") ) .has( Conditions.property("type", "property") ); - } @Test @@ -84,18 +93,26 @@ public class IndexDefinitionsEntryHandlerTest { traverseForIndexing(manager, "index_multiple_files"); IndexDefinitions defs = manager.getIndexes(); - List<DocViewNode2> indexes = defs.getIndexes(); + Map<String, List<DocViewNode2>> indexes = defs.getIndexes(); assertThat(indexes).as("index definitions") + .hasSize(1) + .containsKey("/oak:index"); + + List<DocViewNode2> rootIndexes = indexes.get("/oak:index"); + assertThat(rootIndexes).as("root indexes") .hasSize(2); - assertThat(indexes).as("baz index") + // ensure consistent order + Collections.sort(rootIndexes, (a, b) -> defs.toShortName(a.getName()).compareTo(defs.toShortName(b.getName()))); + + assertThat(rootIndexes).as("baz index") .element(0).has( Conditions.localName("baz") ); - assertThat(indexes).as("lucene_custom index") + assertThat(rootIndexes).as("lucene_custom index") .element(1) .has( Conditions.localName("lucene_custom") ) .has( Conditions.property("type", "lucene") ) - .has(Conditions.childWithLocalName("/oak:index/lucene_custom", "indexRules", defs)); + .has( Conditions.childWithLocalName("/oak:index/lucene_custom", "indexRules", defs)); } @@ -106,14 +123,22 @@ public class IndexDefinitionsEntryHandlerTest { traverseForIndexing(manager, "index_nested_tika"); IndexDefinitions defs = manager.getIndexes(); - List<DocViewNode2> indexes = defs.getIndexes(); + Map<String, List<DocViewNode2>> indexes = defs.getIndexes(); assertThat(indexes).as("index definitions") .hasSize(1) + .containsKey("/oak:index"); + + List<DocViewNode2> rootIndexes = indexes.get("/oak:index"); + assertThat(rootIndexes).as("root indexes") + .hasSize(1); + + assertThat(rootIndexes).as("index definitions") + .hasSize(1) .element(0) .has(Conditions.localName("lucene-custom")); - DocViewNode2 luceneCustom = indexes.get(0); + DocViewNode2 luceneCustom = rootIndexes.get(0); assertThat(luceneCustom).as("lucene index definition") .has(Conditions.childWithLocalName("/oak:index/lucene-custom", "indexRules", defs)) .has(Conditions.childWithLocalName("/oak:index/lucene-custom", "tika", defs)); @@ -142,6 +167,28 @@ public class IndexDefinitionsEntryHandlerTest { } + @Test + public void handleIndexDefinitionUnderNonRootPath() throws IOException, ConverterException { + + DefaultIndexManager manager = new DefaultIndexManager(); + + traverseForIndexing(manager, "index_non_root_path"); + + IndexDefinitions defs = manager.getIndexes(); + Map<String, List<DocViewNode2>> indexes = defs.getIndexes(); + assertThat(indexes).as("index definitions") + .hasSize(1) + .containsKey("/content/oak:index"); + + List<DocViewNode2> contentIndexes = indexes.get("/content/oak:index"); + assertThat(contentIndexes).as("/content indexes") + .hasSize(1) + .element(0) + .has( Conditions.localName("lucene") ) + .has( Conditions.property("type", "lucene") ); + + } + private void assertIsValidXml(byte[] tikeConfig) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/config.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/config.xml new file mode 100644 index 0000000..f1b081a --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/config.xml @@ -0,0 +1,86 @@ +<!-- + 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. + --> +<vaultfs version="1.1"> + <!-- + Defines the content aggregation. The order of the defined aggregates + is important for finding the correct aggregator. + --> + <aggregates> + <!-- + Defines an aggregate that handles nt:file and nt:resource nodes. + --> + <aggregate type="file" title="File Aggregate"/> + + <!-- + Defines an aggregate that handles file/folder like nodes. It matches + all nt:hierarchyNode nodes that have or define a jcr:content + child node and excludes child nodes that are nt:hierarchyNodes. + --> + <aggregate type="filefolder" title="File/Folder Aggregate"/> + + <!-- + Defines an aggregate that defines full coverage for certain node + types that cannot be covered by the default aggregator. + --> + <aggregate type="full" title="Full Coverage Aggregate"> + <matches> + <include nodeType="rep:AccessControl" respectSupertype="true" /> + <include nodeType="rep:Policy" respectSupertype="true" /> + <include nodeType="cq:Widget" respectSupertype="true" /> + <include nodeType="cq:EditConfig" respectSupertype="true" /> + <include nodeType="cq:WorkflowModel" respectSupertype="true" /> + <include nodeType="vlt:FullCoverage" respectSupertype="true" /> + <include nodeType="mix:language" respectSupertype="true" /> + <include nodeType="sling:OsgiConfig" respectSupertype="true" /> + </matches> + </aggregate> + + <!-- + Defines an aggregate that handles nt:folder like nodes. + --> + <aggregate type="generic" title="Folder Aggregate"> + <matches> + <include nodeType="nt:folder" respectSupertype="true" /> + </matches> + <contains> + <exclude isNode="true" /> + </contains> + </aggregate> + + <!-- + Defines the default aggregate + --> + <aggregate type="generic" title="Default Aggregator" isDefault="true"> + <matches> + <!-- all --> + </matches> + <contains> + <exclude nodeType="nt:hierarchyNode" respectSupertype="true" /> + </contains> + </aggregate> + + </aggregates> + + <!-- + defines the input handlers + --> + <handlers> + <handler type="folder"/> + <handler type="file"/> + <handler type="generic"/> + </handlers> +</vaultfs> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/definition/.content.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/definition/.content.xml new file mode 100644 index 0000000..2a9e723 --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/definition/.content.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:vlt="http://www.day.com/jcr/vault/1.0" + jcr:lastModified="{Date}2022-03-04T18:13:03.077+02:00" + jcr:lastModifiedBy="admin" + jcr:primaryType="vlt:PackageDefinition" + buildCount="1" + group="com.example" + lastUnwrapped="{Date}2022-03-04T18:13:03.077+02:00" + lastUnwrappedBy="admin" + lastWrapped="{Date}2022-03-04T18:13:03.077+02:00" + lastWrappedBy="admin" + name="index-under-content" + version="1.0"> + <filter jcr:primaryType="nt:unstructured"> + <f0 + jcr:primaryType="nt:unstructured" + mode="replace" + root="/content/oak:index" + rules="[]"/> + </filter> +</jcr:root> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/filter.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/filter.xml new file mode 100644 index 0000000..cd9c945 --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/filter.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<workspaceFilter version="1.0"> + <filter root="/content/oak:index"/> +</workspaceFilter> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/properties.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/properties.xml new file mode 100644 index 0000000..367512c --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/META-INF/vault/properties.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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 properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>FileVault Package Properties</comment> +<entry key="packageType">content</entry> +<entry key="lastWrappedBy">admin</entry> +<entry key="packageFormatVersion">2</entry> +<entry key="group">com.example</entry> +<entry key="created">2022-03-04T18:13:03.105+02:00</entry> +<entry key="lastModifiedBy">admin</entry> +<entry key="buildCount">1</entry> +<entry key="lastWrapped">2022-03-04T18:13:03.077+02:00</entry> +<entry key="version">1.0</entry> +<entry key="dependencies"></entry> +<entry key="createdBy">admin</entry> +<entry key="name">index-under-content</entry> +<entry key="lastModified">2022-03-04T18:13:03.077+02:00</entry> +</properties> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/.content.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/.content.xml new file mode 100644 index 0000000..741d31d --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/.content.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="rep:root" + sling:resourceType="sling:redirect" + sling:target="/starter.html"/> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/.content.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/.content.xml new file mode 100644 index 0000000..a576d5d --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/.content.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:mixinTypes="[rep:AccessControllable]" + jcr:primaryType="sling:OrderedFolder" + sling:resourceType="sling:redirect" + sling:target="/starter.html"> + <rep:policy/> + <htl/> + <slingshot/> + <starter/> + <oak:index/> +</jcr:root> diff --git a/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/_oak_index/.content.xml b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/_oak_index/.content.xml new file mode 100644 index 0000000..5727fe6 --- /dev/null +++ b/src/test/resources/org/apache/sling/feature/cpconverter/handlers/index/index_non_root_path/jcr_root/content/_oak_index/.content.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="nt:unstructured"> + <lucene + jcr:primaryType="oak:QueryIndexDefinition" + async="async" + includePropertyTypes="[String,Binary]" + reindex="{Boolean}false" + reindexCount="{Long}3" + seed="{Long}4650018324827688380" + type="lucene"> + <indexRules jcr:primaryType="nt:unstructured"> + <nt:base + jcr:primaryType="nt:unstructured" + includePropertyTypes="[String,Binary]"> + <properties jcr:primaryType="nt:unstructured"> + <sling:alias + jcr:primaryType="nt:unstructured" + index="{Boolean}false" + name="sling:alias"/> + <jcr:lastmodifiedby + jcr:primaryType="nt:unstructured" + index="{Boolean}false" + name="jcr:lastmodifiedby"/> + <sling:resourcetype + jcr:primaryType="nt:unstructured" + index="{Boolean}false" + name="sling:resourcetype"/> + <jcr:createdby + jcr:primaryType="nt:unstructured" + index="{Boolean}false" + name="jcr:createdby"/> + <sling:vanitypath + jcr:primaryType="nt:unstructured" + index="{Boolean}false" + name="sling:vanitypath"/> + <prop0 + jcr:primaryType="nt:unstructured" + analyzed="{Boolean}true" + isRegexp="{Boolean}true" + name="^[^\\/]*$" + nodeScopeIndex="{Boolean}true" + propertyIndex="{Boolean}false" + useInExcerpt="{Boolean}true"/> + </properties> + </nt:base> + </indexRules> + </lucene> +</jcr:root>
