use of com.enonic.xp.content.ReorderChildContentsResult in project xp by enonic.
the class ContentServiceImpl method reorderChildren.
@Override
public ReorderChildContentsResult reorderChildren(final ReorderChildContentsParams params) {
final ReorderChildNodesParams.Builder builder = ReorderChildNodesParams.create();
for (final ReorderChildParams param : params) {
builder.add(ReorderChildNodeParams.create().nodeId(NodeId.from(param.getContentToMove())).moveBefore(param.getContentToMoveBefore() == null ? null : NodeId.from(param.getContentToMoveBefore())).build());
}
if (params.stopInherit()) {
builder.processor(new SetContentChildOrderProcessor());
}
final ReorderChildNodesResult reorderChildNodesResult = this.nodeService.reorderChildren(builder.build());
this.nodeService.refresh(RefreshMode.SEARCH);
final ReorderChildContentsResult result = new ReorderChildContentsResult(reorderChildNodesResult.getSize());
contentAuditLogSupport.reorderChildren(params, result);
return result;
}
Aggregations