Search in sources :

Example 21 with PatternIndexConfigDocument

use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.

the class IndexConfigFactoryTest method path_index_configs.

@Test
public void path_index_configs() throws Exception {
    final PatternIndexConfigDocument fullConfig = createFullConfig();
    final ImmutableSortedSet<PathIndexConfig> pathIndexConfigs = fullConfig.getPathIndexConfigs();
    assertEquals(3, pathIndexConfigs.size());
    assertEquals(IndexConfig.FULLTEXT, fullConfig.getConfigForPath(PropertyPath.from("displayName")));
}
Also used : PathIndexConfig(com.enonic.xp.index.PathIndexConfig) PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) Test(org.junit.jupiter.api.Test)

Example 22 with PatternIndexConfigDocument

use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.

the class NodeEditTest method edit_index_config.

@Test
public void edit_index_config() throws Exception {
    final Node node = createNode();
    final PatternIndexConfigDocument newIndexConfig = PatternIndexConfigDocument.create().defaultConfig(IndexConfig.FULLTEXT).build();
    final Node editedNode = Node.create(node).indexConfigDocument(newIndexConfig).build();
    assertEquals(newIndexConfig, editedNode.getIndexConfigDocument());
}
Also used : PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) Test(org.junit.jupiter.api.Test)

Example 23 with PatternIndexConfigDocument

use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.

the class PageRegionsConfigProcessorTest method test_fragment_component.

@Test
public void test_fragment_component() throws Exception {
    final Page page = Page.create().regions(PageRegions.create().add(Region.create().name("region1").add(FragmentComponent.create().fragment(ContentId.from("content-id")).build()).build()).build()).build();
    final PatternIndexConfigDocument result = processPage(page, singletonList(configFormWithHtmlArea).listIterator(), null);
    assertTrue(result.getPathIndexConfigs().contains(PathIndexConfig.create().path(PropertyPath.from(COMPONENTS, FragmentComponentType.INSTANCE.toString(), ID)).indexConfig(IndexConfig.MINIMAL).build()));
}
Also used : Page(com.enonic.xp.page.Page) PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) Test(org.junit.jupiter.api.Test)

Example 24 with PatternIndexConfigDocument

use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.

the class PageRegionsConfigProcessorTest method test_part_component.

@Test
public void test_part_component() throws Exception {
    final DescriptorKey partDescriptorKey = DescriptorKey.from("part1AppKey:name");
    final String htmlarea = "htmlarea";
    final Page page = Page.create().regions(PageRegions.create().add(Region.create().name("region1").add(PartComponent.create().descriptor(partDescriptorKey).build()).build()).build()).build();
    final PatternIndexConfigDocument result = processPage(page, Arrays.asList(configFormWithHtmlArea).listIterator(), null);
    assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(COMPONENTS, PartComponentType.INSTANCE.toString(), CONFIG, partDescriptorKey.getApplicationKey().toString(), partDescriptorKey.getName(), htmlarea)).getIndexValueProcessors().get(0).getName());
}
Also used : DescriptorKey(com.enonic.xp.page.DescriptorKey) Page(com.enonic.xp.page.Page) PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) Test(org.junit.jupiter.api.Test)

Example 25 with PatternIndexConfigDocument

use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.

the class PageRegionsConfigProcessorTest method test_size.

@Test
public void test_size() throws Exception {
    final PatternIndexConfigDocument result = processPage(Page.create().regions(PageRegions.create().build()).build(), null, null);
    assertEquals(5, result.getPathIndexConfigs().size());
}
Also used : PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) Test(org.junit.jupiter.api.Test)

Aggregations

PatternIndexConfigDocument (com.enonic.xp.index.PatternIndexConfigDocument)33 Test (org.junit.jupiter.api.Test)26 Form (com.enonic.xp.form.Form)10 PropertyTree (com.enonic.xp.data.PropertyTree)9 PropertySet (com.enonic.xp.data.PropertySet)5 Page (com.enonic.xp.page.Page)5 Input (com.enonic.xp.form.Input)4 PathIndexConfig (com.enonic.xp.index.PathIndexConfig)3 NodeVersion (com.enonic.xp.node.NodeVersion)3 DescriptorKey (com.enonic.xp.page.DescriptorKey)3 SiteConfigs (com.enonic.xp.site.SiteConfigs)3 DumpUpgradeStepResult (com.enonic.xp.dump.DumpUpgradeStepResult)2 IndexConfigDocument (com.enonic.xp.index.IndexConfigDocument)2 Reference (com.enonic.xp.util.Reference)2 ContentConstants (com.enonic.xp.content.ContentConstants)1 Property (com.enonic.xp.data.Property)1 PropertyPath (com.enonic.xp.data.PropertyPath)1 PropertyVisitor (com.enonic.xp.data.PropertyVisitor)1 ValueFactory (com.enonic.xp.data.ValueFactory)1 ValueTypes (com.enonic.xp.data.ValueTypes)1