Search in sources :

Example 1 with DeleteResourceSuccess

use of com.willshex.blogwt.client.api.blog.event.DeleteResourceEventHandler.DeleteResourceSuccess in project blogwt by billy1380.

the class ResourceController method deleteResource.

public void deleteResource(Resource resource) {
    final DeleteResourceRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new DeleteResourceRequest())).resource(resource);
    ApiHelper.createBlogClient().deleteResource(input, new AsyncCallback<DeleteResourceResponse>() {

        @Override
        public void onSuccess(DeleteResourceResponse output) {
            if (output.status == StatusType.StatusTypeSuccess) {
                if (input.resource != null) {
                }
            }
            DefaultEventBus.get().fireEventFromSource(new DeleteResourceSuccess(input, output), ResourceController.this);
        }

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new DeleteResourceFailure(input, caught), ResourceController.this);
        }
    });
}
Also used : DeleteResourceResponse(com.willshex.blogwt.shared.api.blog.call.DeleteResourceResponse) DeleteResourceFailure(com.willshex.blogwt.client.api.blog.event.DeleteResourceEventHandler.DeleteResourceFailure) DeleteResourceSuccess(com.willshex.blogwt.client.api.blog.event.DeleteResourceEventHandler.DeleteResourceSuccess) DeleteResourceRequest(com.willshex.blogwt.shared.api.blog.call.DeleteResourceRequest)

Aggregations

DeleteResourceFailure (com.willshex.blogwt.client.api.blog.event.DeleteResourceEventHandler.DeleteResourceFailure)1 DeleteResourceSuccess (com.willshex.blogwt.client.api.blog.event.DeleteResourceEventHandler.DeleteResourceSuccess)1 DeleteResourceRequest (com.willshex.blogwt.shared.api.blog.call.DeleteResourceRequest)1 DeleteResourceResponse (com.willshex.blogwt.shared.api.blog.call.DeleteResourceResponse)1