use of com.enonic.xp.core.impl.content.index.IndexConfigVisitor in project xp by enonic.
the class PageConfigProcessor method applyConfigProcessors.
private void applyConfigProcessors(final PatternIndexConfigDocument.Builder builder) {
if (this.pageConfigForm == null || this.pageConfigForm.size() == 0) {
return;
}
final String appNameAsString = getSanitizedAppName(page.getDescriptor());
final String componentNameAsString = getSanitizedComponentName(page.getDescriptor());
final IndexConfigVisitor indexConfigVisitor = new IndexConfigVisitor(String.join(ELEMENT_DIVIDER, COMPONENTS, PAGE, CONFIG, appNameAsString, componentNameAsString), builder);
indexConfigVisitor.traverse(pageConfigForm);
builder.add(String.join(ELEMENT_DIVIDER, COMPONENTS, PAGE, CONFIG, appNameAsString, componentNameAsString), IndexConfig.BY_TYPE);
}
use of com.enonic.xp.core.impl.content.index.IndexConfigVisitor in project xp by enonic.
the class XDataConfigProcessor method processDocument.
@Override
public PatternIndexConfigDocument.Builder processDocument(final PatternIndexConfigDocument.Builder builder) {
builder.add(PropertyPath.from(EXTRA_DATA, "*"), IndexConfig.BY_TYPE);
if (this.xDatas != null) {
this.xDatas.forEach(xData -> {
final IndexConfigVisitor indexConfigVisitor = new IndexConfigVisitor(String.join(".", EXTRA_DATA, xData.getName().getApplicationPrefix(), xData.getName().getLocalName()), builder);
indexConfigVisitor.traverse(xData.getForm());
});
}
return builder;
}
use of com.enonic.xp.core.impl.content.index.IndexConfigVisitor in project xp by enonic.
the class DataConfigProcessor method processDocument.
@Override
public PatternIndexConfigDocument.Builder processDocument(final PatternIndexConfigDocument.Builder builder) {
builder.add(DATA, IndexConfig.BY_TYPE);
if (this.dataForm != null && this.dataForm.getFormItems().size() > 0) {
final IndexConfigVisitor indexConfigVisitor = new IndexConfigVisitor(DATA, builder);
indexConfigVisitor.traverse(this.dataForm);
}
return builder;
}
use of com.enonic.xp.core.impl.content.index.IndexConfigVisitor in project xp by enonic.
the class SiteConfigProcessor method processDocument.
@Override
public PatternIndexConfigDocument.Builder processDocument(final PatternIndexConfigDocument.Builder builder) {
if (this.sizeConfigForms != null && this.sizeConfigForms.size() > 0) {
sizeConfigForms.forEach(form -> {
final IndexConfigVisitor indexConfigVisitor = new IndexConfigVisitor(String.join(PropertyPath.ELEMENT_DIVIDER, DATA, SITECONFIG, "config"), builder);
indexConfigVisitor.traverse(form);
});
}
return builder;
}
use of com.enonic.xp.core.impl.content.index.IndexConfigVisitor in project xp by enonic.
the class PageRegionsConfigProcessor method processDescriptorBasedComponent.
private void processDescriptorBasedComponent(final DescriptorBasedComponent component, final PatternIndexConfigDocument.Builder builder) {
final String appNameAsString = getSanitizedAppName(component.getDescriptor());
final String componentNameAsString = getSanitizedComponentName(component.getDescriptor());
final IndexConfigVisitor indexConfigVisitor = new IndexConfigVisitor(String.join(ELEMENT_DIVIDER, COMPONENTS, component.getType().toString(), CONFIG, appNameAsString, componentNameAsString), builder);
indexConfigVisitor.traverse(getComponentConfig(component));
builder.add(String.join(ELEMENT_DIVIDER, COMPONENTS, component.getType().toString(), CONFIG, appNameAsString, componentNameAsString), IndexConfig.BY_TYPE);
if (component instanceof LayoutComponent) {
parseLayoutRegions(((LayoutComponent) component).getRegions(), builder);
}
}
Aggregations