Search in sources :

Example 1 with MoveNodeException

use of com.enonic.xp.node.MoveNodeException in project xp by enonic.

the class ArchiveContentCommand method execute.

ArchiveContentsResult execute() {
    params.validate();
    try {
        final ArchiveContentsResult archivedContents = doExecute();
        this.nodeService.refresh(RefreshMode.ALL);
        return archivedContents;
    } catch (MoveNodeException e) {
        throw new ArchiveContentException(e.getMessage(), ContentNodeHelper.translateNodePathToContentPath(e.getPath()));
    } catch (NodeAccessException e) {
        throw new ContentAccessException(e);
    }
}
Also used : MoveNodeException(com.enonic.xp.node.MoveNodeException) NodeAccessException(com.enonic.xp.node.NodeAccessException) ArchiveContentException(com.enonic.xp.archive.ArchiveContentException) ArchiveContentsResult(com.enonic.xp.archive.ArchiveContentsResult) ContentAccessException(com.enonic.xp.content.ContentAccessException)

Example 2 with MoveNodeException

use of com.enonic.xp.node.MoveNodeException 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)

Example 3 with MoveNodeException

use of com.enonic.xp.node.MoveNodeException in project xp by enonic.

the class RestoreContentCommand method execute.

RestoreContentsResult execute() {
    params.validate();
    try {
        final RestoreContentsResult restoredContents = doExecute();
        this.nodeService.refresh(RefreshMode.ALL);
        return restoredContents;
    } catch (MoveNodeException e) {
        throw new RestoreContentException(e.getMessage(), ContentNodeHelper.translateNodePathToContentPath(e.getPath()));
    } catch (NodeAccessException e) {
        throw new ContentAccessException(e);
    }
}
Also used : RestoreContentsResult(com.enonic.xp.archive.RestoreContentsResult) MoveNodeException(com.enonic.xp.node.MoveNodeException) NodeAccessException(com.enonic.xp.node.NodeAccessException) RestoreContentException(com.enonic.xp.archive.RestoreContentException) ContentAccessException(com.enonic.xp.content.ContentAccessException)

Aggregations

ContentAccessException (com.enonic.xp.content.ContentAccessException)3 MoveNodeException (com.enonic.xp.node.MoveNodeException)3 NodeAccessException (com.enonic.xp.node.NodeAccessException)3 ArchiveContentException (com.enonic.xp.archive.ArchiveContentException)1 ArchiveContentsResult (com.enonic.xp.archive.ArchiveContentsResult)1 RestoreContentException (com.enonic.xp.archive.RestoreContentException)1 RestoreContentsResult (com.enonic.xp.archive.RestoreContentsResult)1 ContentAlreadyExistsException (com.enonic.xp.content.ContentAlreadyExistsException)1 MoveContentException (com.enonic.xp.content.MoveContentException)1 MoveContentsResult (com.enonic.xp.content.MoveContentsResult)1 NodeAlreadyExistAtPathException (com.enonic.xp.node.NodeAlreadyExistAtPathException)1