Search in sources :

Example 1 with DuplicateContentsResult

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

the class ContentServiceImpl method duplicate.

@Override
public DuplicateContentsResult duplicate(final DuplicateContentParams params) {
    final DuplicateContentsResult result = DuplicateContentCommand.create(params).nodeService(this.nodeService).contentTypeService(this.contentTypeService).translator(this.translator).eventPublisher(this.eventPublisher).duplicateListener(params.getDuplicateContentListener()).build().execute();
    contentAuditLogSupport.duplicate(params, result);
    return result;
}
Also used : DuplicateContentsResult(com.enonic.xp.content.DuplicateContentsResult)

Example 2 with DuplicateContentsResult

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

the class ContentServiceImplTest_duplicate method doDuplicateContent.

private Content doDuplicateContent(final Content content, final Boolean includeChildren) {
    final DuplicateContentParams params = DuplicateContentParams.create().contentId(content.getId()).includeChildren(includeChildren).build();
    final DuplicateContentsResult result = contentService.duplicate(params);
    return this.contentService.getById(result.getDuplicatedContents().first());
}
Also used : DuplicateContentParams(com.enonic.xp.content.DuplicateContentParams) DuplicateContentsResult(com.enonic.xp.content.DuplicateContentsResult)

Example 3 with DuplicateContentsResult

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

the class ContentServiceImplTest_publish_update_publishedTime method doDuplicateContent.

private Content doDuplicateContent(final Content rootContent) {
    final DuplicateContentParams params = DuplicateContentParams.create().contentId(rootContent.getId()).build();
    final DuplicateContentsResult result = contentService.duplicate(params);
    return this.contentService.getById(result.getDuplicatedContents().first());
}
Also used : DuplicateContentParams(com.enonic.xp.content.DuplicateContentParams) DuplicateContentsResult(com.enonic.xp.content.DuplicateContentsResult)

Aggregations

DuplicateContentsResult (com.enonic.xp.content.DuplicateContentsResult)3 DuplicateContentParams (com.enonic.xp.content.DuplicateContentParams)2