Search in sources :

Example 1 with UpdateResourceSuccess

use of com.willshex.blogwt.client.api.blog.event.UpdateResourceEventHandler.UpdateResourceSuccess in project blogwt by billy1380.

the class ResourceController method updateResource.

public void updateResource(Resource resource) {
    final UpdateResourceRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new UpdateResourceRequest())).resource(resource);
    ApiHelper.createBlogClient().updateResource(input, new AsyncCallback<UpdateResourceResponse>() {

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

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new UpdateResourceFailure(input, caught), ResourceController.this);
        }
    });
}
Also used : UpdateResourceRequest(com.willshex.blogwt.shared.api.blog.call.UpdateResourceRequest) UpdateResourceResponse(com.willshex.blogwt.shared.api.blog.call.UpdateResourceResponse) UpdateResourceFailure(com.willshex.blogwt.client.api.blog.event.UpdateResourceEventHandler.UpdateResourceFailure) UpdateResourceSuccess(com.willshex.blogwt.client.api.blog.event.UpdateResourceEventHandler.UpdateResourceSuccess)

Aggregations

UpdateResourceFailure (com.willshex.blogwt.client.api.blog.event.UpdateResourceEventHandler.UpdateResourceFailure)1 UpdateResourceSuccess (com.willshex.blogwt.client.api.blog.event.UpdateResourceEventHandler.UpdateResourceSuccess)1 UpdateResourceRequest (com.willshex.blogwt.shared.api.blog.call.UpdateResourceRequest)1 UpdateResourceResponse (com.willshex.blogwt.shared.api.blog.call.UpdateResourceResponse)1