Search in sources :

Example 1 with CreatePageFailure

use of com.willshex.blogwt.client.api.page.event.CreatePageEventHandler.CreatePageFailure in project blogwt by billy1380.

the class PageController method createPage.

/**
 * @param page
 */
public void createPage(Page page) {
    final CreatePageRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new CreatePageRequest())).page(page);
    ApiHelper.createPageClient().createPage(input, new AsyncCallback<CreatePageResponse>() {

        @Override
        public void onSuccess(CreatePageResponse output) {
            if (output.status == StatusType.StatusTypeSuccess) {
            }
            DefaultEventBus.get().fireEventFromSource(new CreatePageSuccess(input, output), PageController.this);
        }

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new CreatePageFailure(input, caught), PageController.this);
        }
    });
}
Also used : CreatePageResponse(com.willshex.blogwt.shared.api.page.call.CreatePageResponse) CreatePageFailure(com.willshex.blogwt.client.api.page.event.CreatePageEventHandler.CreatePageFailure) CreatePageRequest(com.willshex.blogwt.shared.api.page.call.CreatePageRequest) CreatePageSuccess(com.willshex.blogwt.client.api.page.event.CreatePageEventHandler.CreatePageSuccess)

Aggregations

CreatePageFailure (com.willshex.blogwt.client.api.page.event.CreatePageEventHandler.CreatePageFailure)1 CreatePageSuccess (com.willshex.blogwt.client.api.page.event.CreatePageEventHandler.CreatePageSuccess)1 CreatePageRequest (com.willshex.blogwt.shared.api.page.call.CreatePageRequest)1 CreatePageResponse (com.willshex.blogwt.shared.api.page.call.CreatePageResponse)1