Search in sources :

Example 6 with ContentAccessException

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

the class DeleteContentCommand method execute.

DeleteContentsResult execute() {
    params.validate();
    try {
        final DeleteContentsResult deletedContents = doExecute();
        nodeService.refresh(RefreshMode.SEARCH);
        return deletedContents;
    } catch (NodeAccessException e) {
        throw new ContentAccessException(e);
    }
}
Also used : NodeAccessException(com.enonic.xp.node.NodeAccessException) DeleteContentsResult(com.enonic.xp.content.DeleteContentsResult) ContentAccessException(com.enonic.xp.content.ContentAccessException)

Example 7 with ContentAccessException

use of com.enonic.xp.content.ContentAccessException 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)7 NodeAccessException (com.enonic.xp.node.NodeAccessException)7 MoveNodeException (com.enonic.xp.node.MoveNodeException)3 ContentAlreadyExistsException (com.enonic.xp.content.ContentAlreadyExistsException)2 Node (com.enonic.xp.node.Node)2 NodeAlreadyExistAtPathException (com.enonic.xp.node.NodeAlreadyExistAtPathException)2 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 Content (com.enonic.xp.content.Content)1 CreateContentParams (com.enonic.xp.content.CreateContentParams)1 CreateContentTranslatorParams (com.enonic.xp.content.CreateContentTranslatorParams)1 DeleteContentsResult (com.enonic.xp.content.DeleteContentsResult)1 MoveContentException (com.enonic.xp.content.MoveContentException)1 MoveContentsResult (com.enonic.xp.content.MoveContentsResult)1 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)1 SetNodeChildOrderParams (com.enonic.xp.node.SetNodeChildOrderParams)1 ContentType (com.enonic.xp.schema.content.ContentType)1 GetContentTypeParams (com.enonic.xp.schema.content.GetContentTypeParams)1