Search in sources :

Example 1 with MoveContentException

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

the class MoveContentCommand method execute.

MoveContentsResult execute() {
    params.validate();
    try {
        final MoveContentsResult movedContents = doExecute();
        this.nodeService.refresh(RefreshMode.ALL);
        return movedContents;
    } catch (MoveNodeException e) {
        throw new MoveContentException(e.getMessage(), ContentPath.from(e.getPath().toString()));
    } catch (NodeAlreadyExistAtPathException e) {
        throw new ContentAlreadyExistsException(ContentPath.from(e.getNode().toString()), e.getRepositoryId(), e.getBranch());
    } catch (NodeAccessException e) {
        throw new ContentAccessException(e);
    }
}
Also used : MoveNodeException(com.enonic.xp.node.MoveNodeException) NodeAccessException(com.enonic.xp.node.NodeAccessException) MoveContentException(com.enonic.xp.content.MoveContentException) MoveContentsResult(com.enonic.xp.content.MoveContentsResult) ContentAlreadyExistsException(com.enonic.xp.content.ContentAlreadyExistsException) NodeAlreadyExistAtPathException(com.enonic.xp.node.NodeAlreadyExistAtPathException) ContentAccessException(com.enonic.xp.content.ContentAccessException)

Aggregations

ContentAccessException (com.enonic.xp.content.ContentAccessException)1 ContentAlreadyExistsException (com.enonic.xp.content.ContentAlreadyExistsException)1 MoveContentException (com.enonic.xp.content.MoveContentException)1 MoveContentsResult (com.enonic.xp.content.MoveContentsResult)1 MoveNodeException (com.enonic.xp.node.MoveNodeException)1 NodeAccessException (com.enonic.xp.node.NodeAccessException)1 NodeAlreadyExistAtPathException (com.enonic.xp.node.NodeAlreadyExistAtPathException)1