Search in sources :

Example 1 with GetResourceSuccess

use of com.willshex.blogwt.client.api.blog.event.GetResourceEventHandler.GetResourceSuccess in project blogwt by billy1380.

the class ResourceController method getResource.

public void getResource(Resource resource) {
    final GetResourceRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new GetResourceRequest())).resource(resource);
    ApiHelper.createBlogClient().getResource(input, new AsyncCallback<GetResourceResponse>() {

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

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new GetResourceFailure(input, caught), ResourceController.this);
        }
    });
}
Also used : GetResourceRequest(com.willshex.blogwt.shared.api.blog.call.GetResourceRequest) GetResourceResponse(com.willshex.blogwt.shared.api.blog.call.GetResourceResponse) GetResourceSuccess(com.willshex.blogwt.client.api.blog.event.GetResourceEventHandler.GetResourceSuccess) GetResourceFailure(com.willshex.blogwt.client.api.blog.event.GetResourceEventHandler.GetResourceFailure)

Aggregations

GetResourceFailure (com.willshex.blogwt.client.api.blog.event.GetResourceEventHandler.GetResourceFailure)1 GetResourceSuccess (com.willshex.blogwt.client.api.blog.event.GetResourceEventHandler.GetResourceSuccess)1 GetResourceRequest (com.willshex.blogwt.shared.api.blog.call.GetResourceRequest)1 GetResourceResponse (com.willshex.blogwt.shared.api.blog.call.GetResourceResponse)1