Search in sources :

Example 1 with ContentIndexConfigFactory

use of com.enonic.xp.core.impl.content.index.ContentIndexConfigFactory in project xp by enonic.

the class UpdateNodeParamsFactory method toNodeEditor.

private NodeEditor toNodeEditor(final UpdateContentTranslatorParams params) {
    final Content content = params.getEditedContent();
    final PropertyTree nodeData = contentDataSerializer.toUpdateNodeData(params);
    final ContentIndexConfigFactory indexConfigFactory = ContentIndexConfigFactory.create().contentTypeService(contentTypeService).pageDescriptorService(pageDescriptorService).partDescriptorService(partDescriptorService).layoutDescriptorService(layoutDescriptorService).siteService(this.siteService).xDataService(this.xDataService).contentTypeName(content.getType()).page(content.getPage()).siteConfigs(content.isSite() ? ((Site) content).getSiteConfigs() : null).extraDatas(content.getAllExtraData()).language(content.getLanguage() != null ? content.getLanguage().getLanguage() : null).build();
    return editableNode -> {
        editableNode.indexConfigDocument = indexConfigFactory.produce();
        editableNode.data = nodeData;
        editableNode.manualOrderValue = content.getManualOrderValue();
        editableNode.permissions = content.getPermissions();
        editableNode.inheritPermissions = content.inheritsPermissions();
    };
}
Also used : PartDescriptorService(com.enonic.xp.region.PartDescriptorService) SiteService(com.enonic.xp.site.SiteService) Content(com.enonic.xp.content.Content) LayoutDescriptorService(com.enonic.xp.region.LayoutDescriptorService) ContentTypeService(com.enonic.xp.schema.content.ContentTypeService) NodeId(com.enonic.xp.node.NodeId) UpdateNodeParams(com.enonic.xp.node.UpdateNodeParams) PageDescriptorService(com.enonic.xp.page.PageDescriptorService) Site(com.enonic.xp.site.Site) CreateAttachments(com.enonic.xp.attachment.CreateAttachments) CreateAttachment(com.enonic.xp.attachment.CreateAttachment) ContentDataSerializer(com.enonic.xp.core.impl.content.serializer.ContentDataSerializer) Preconditions(com.google.common.base.Preconditions) ContentIndexConfigFactory(com.enonic.xp.core.impl.content.index.ContentIndexConfigFactory) UpdateContentTranslatorParams(com.enonic.xp.content.UpdateContentTranslatorParams) NodeEditor(com.enonic.xp.node.NodeEditor) XDataService(com.enonic.xp.schema.xdata.XDataService) PropertyTree(com.enonic.xp.data.PropertyTree) Content(com.enonic.xp.content.Content) PropertyTree(com.enonic.xp.data.PropertyTree) ContentIndexConfigFactory(com.enonic.xp.core.impl.content.index.ContentIndexConfigFactory)

Aggregations

CreateAttachment (com.enonic.xp.attachment.CreateAttachment)1 CreateAttachments (com.enonic.xp.attachment.CreateAttachments)1 Content (com.enonic.xp.content.Content)1 UpdateContentTranslatorParams (com.enonic.xp.content.UpdateContentTranslatorParams)1 ContentIndexConfigFactory (com.enonic.xp.core.impl.content.index.ContentIndexConfigFactory)1 ContentDataSerializer (com.enonic.xp.core.impl.content.serializer.ContentDataSerializer)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 NodeEditor (com.enonic.xp.node.NodeEditor)1 NodeId (com.enonic.xp.node.NodeId)1 UpdateNodeParams (com.enonic.xp.node.UpdateNodeParams)1 PageDescriptorService (com.enonic.xp.page.PageDescriptorService)1 LayoutDescriptorService (com.enonic.xp.region.LayoutDescriptorService)1 PartDescriptorService (com.enonic.xp.region.PartDescriptorService)1 ContentTypeService (com.enonic.xp.schema.content.ContentTypeService)1 XDataService (com.enonic.xp.schema.xdata.XDataService)1 Site (com.enonic.xp.site.Site)1 SiteService (com.enonic.xp.site.SiteService)1 Preconditions (com.google.common.base.Preconditions)1