Search in sources :

Example 6 with ContentInheritType

use of com.enonic.xp.content.ContentInheritType in project xp by enonic.

the class ResetInheritanceHandler method doExecute.

@Override
protected Object doExecute() {
    validate();
    Content content;
    if (this.key.startsWith("/")) {
        content = contentService.getByPath(ContentPath.from(this.key));
    } else {
        content = contentService.getById(ContentId.from(this.key));
    }
    syncContentService.get().resetInheritance(ResetContentInheritParams.create().contentId(content.getId()).projectName(ProjectName.from(projectName)).inherit(inherit.stream().map(ContentInheritType::valueOf).collect(Collectors.toSet())).build());
    return null;
}
Also used : Content(com.enonic.xp.content.Content) ContentInheritType(com.enonic.xp.content.ContentInheritType)

Aggregations

ContentInheritType (com.enonic.xp.content.ContentInheritType)6 Content (com.enonic.xp.content.Content)4 ContentId (com.enonic.xp.content.ContentId)3 Test (org.junit.jupiter.api.Test)2 ContentConstants (com.enonic.xp.content.ContentConstants)1 ContentPath (com.enonic.xp.content.ContentPath)1 ContentService (com.enonic.xp.content.ContentService)1 ResetContentInheritParams (com.enonic.xp.content.ResetContentInheritParams)1 UpdateContentParams (com.enonic.xp.content.UpdateContentParams)1 WorkflowInfo (com.enonic.xp.content.WorkflowInfo)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 PropertySet (com.enonic.xp.data.PropertySet)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 BinaryAttachment (com.enonic.xp.node.BinaryAttachment)1 BinaryAttachments (com.enonic.xp.node.BinaryAttachments)1 Node (com.enonic.xp.node.Node)1 Project (com.enonic.xp.project.Project)1 ProjectName (com.enonic.xp.project.ProjectName)1