use of com.enonic.xp.content.ContentName in project xp by enonic.
the class RenamedEventSyncCommand method doSync.
private void doSync(final ContentToSync content) {
content.getTargetContext().runWith(() -> {
if (isToSyncName(content.getTargetContent())) {
if (needToRename(content.getSourceContent(), content.getTargetContent())) {
final ContentName newName = ContentName.from(buildNewPath(content.getTargetContent().getParentPath(), content.getSourceContent().getName()).getName());
contentService.rename(RenameContentParams.create().contentId(content.getTargetContent().getId()).newName(newName).stopInherit(!newName.equals(content.getSourceContent().getName())).build());
}
}
});
}
use of com.enonic.xp.content.ContentName in project xp by enonic.
the class MoveContentHandler method rename.
private Content rename(final ContentId sourceId, final String newName) {
final ContentName newContentName = ContentName.from(newName);
final RenameContentParams renameParams = RenameContentParams.create().contentId(sourceId).newName(newContentName).build();
return contentService.rename(renameParams);
}
Aggregations