Search in sources :

Example 6 with SiteConfigs

use of com.enonic.xp.site.SiteConfigs 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());
}
Also used : Form(com.enonic.xp.form.Form) PropertyTree(com.enonic.xp.data.PropertyTree) PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) SiteConfigs(com.enonic.xp.site.SiteConfigs) Test(org.junit.jupiter.api.Test)

Aggregations

SiteConfigs (com.enonic.xp.site.SiteConfigs)6 PropertyTree (com.enonic.xp.data.PropertyTree)4 Form (com.enonic.xp.form.Form)3 PatternIndexConfigDocument (com.enonic.xp.index.PatternIndexConfigDocument)3 Test (org.junit.jupiter.api.Test)3 SiteConfigsDataSerializer (com.enonic.xp.site.SiteConfigsDataSerializer)2 ApplicationKey (com.enonic.xp.app.ApplicationKey)1 CreateAttachment (com.enonic.xp.attachment.CreateAttachment)1 ExtraDatas (com.enonic.xp.content.ExtraDatas)1 Context (com.enonic.xp.context.Context)1 ContentIndexConfigFactory (com.enonic.xp.core.impl.content.index.ContentIndexConfigFactory)1 PropertySet (com.enonic.xp.data.PropertySet)1 IndexConfigDocument (com.enonic.xp.index.IndexConfigDocument)1 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)1 Page (com.enonic.xp.page.Page)1 ProjectName (com.enonic.xp.project.ProjectName)1 AuthenticationInfo (com.enonic.xp.security.auth.AuthenticationInfo)1 Site (com.enonic.xp.site.Site)1 SiteConfig (com.enonic.xp.site.SiteConfig)1 SiteDescriptor (com.enonic.xp.site.SiteDescriptor)1