use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class PageRegionsConfigProcessorTest method test_layout_component.
@Test
public void test_layout_component() throws Exception {
final DescriptorKey layoutDescriptorKey = DescriptorKey.from("layoutAppKey:name");
final String htmlarea = "htmlarea";
final Page page = Page.create().regions(PageRegions.create().add(Region.create().name("region1").add(LayoutComponent.create().descriptor(layoutDescriptorKey).regions(LayoutRegions.create().build()).build()).build()).build()).build();
final PatternIndexConfigDocument result = processPage(page, null, Arrays.asList(configFormWithHtmlArea).listIterator());
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(COMPONENTS, LayoutComponentType.INSTANCE.toString(), CONFIG, layoutDescriptorKey.getApplicationKey().toString(), layoutDescriptorKey.getName(), htmlarea)).getIndexValueProcessors().get(0).getName());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class SiteConfigProcessorTest method test_multiple_site_configs_with_html_areas.
@Test
public void test_multiple_site_configs_with_html_areas() throws Exception {
final Form form1 = Form.create().addFormItem(Input.create().name("text1").label("text1").inputType(InputTypeName.HTML_AREA).build()).build();
final Form form2 = Form.create().addFormItem(Input.create().name("text2").label("text2").inputType(InputTypeName.HTML_AREA).build()).build();
final SiteConfigs siteConfigs = SiteConfigs.create().add(SiteConfig.create().application(applicationKey1).config(new PropertyTree()).build()).add(SiteConfig.create().application(applicationKey2).config(new PropertyTree()).build()).build();
final PatternIndexConfigDocument result = processConfigs(siteConfigs, form1, form2);
assertEquals(2, result.getPathIndexConfigs().size());
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(ContentPropertyNames.DATA, SITECONFIG, "config", "text1")).getIndexValueProcessors().get(0).getName());
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(ContentPropertyNames.DATA, SITECONFIG, "config", "text2")).getIndexValueProcessors().get(0).getName());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class SiteConfigProcessorTest method test_site_config_with_html_area.
@Test
public void test_site_config_with_html_area() throws Exception {
final Form form = Form.create().addFormItem(Input.create().name("text1").label("text1").inputType(InputTypeName.HTML_AREA).build()).build();
final SiteConfigs siteConfigs = SiteConfigs.create().add(SiteConfig.create().application(applicationKey1).config(new PropertyTree()).build()).build();
final PatternIndexConfigDocument result = processConfigs(siteConfigs, form);
assertEquals(1, result.getPathIndexConfigs().size());
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(ContentPropertyNames.DATA, SITECONFIG, "config", "text1")).getIndexValueProcessors().get(0).getName());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class SiteConfigProcessorTest method test_multiple_site_configs_with_same_path.
@Test
public void test_multiple_site_configs_with_same_path() throws Exception {
final Form form1 = Form.create().addFormItem(Input.create().name("text1").label("text1").inputType(InputTypeName.HTML_AREA).build()).build();
final Form form2 = Form.create().addFormItem(Input.create().name("text1").label("text1").inputType(InputTypeName.HTML_AREA).build()).build();
final SiteConfigs siteConfigs = SiteConfigs.create().add(SiteConfig.create().application(applicationKey1).config(new PropertyTree()).build()).add(SiteConfig.create().application(applicationKey2).config(new PropertyTree()).build()).build();
final PatternIndexConfigDocument result = processConfigs(siteConfigs, form1, form2);
assertEquals(1, result.getPathIndexConfigs().size());
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(ContentPropertyNames.DATA, SITECONFIG, "config", "text1")).getIndexValueProcessors().get(0).getName());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class XDataConfigProcessorTest method test_data.
@Test
public void test_data() throws Exception {
final PatternIndexConfigDocument result = processForms(Form.create().build());
assertEquals(1, result.getPathIndexConfigs().size());
assertEquals(IndexConfig.BY_TYPE, result.getConfigForPath(PropertyPath.from(EXTRA_DATA)));
}
Aggregations