use of com.willshex.blogwt.client.api.page.event.GetPageEventHandler.GetPageFailure in project blogwt by billy1380.
the class PageController method getPage.
/**
* @param page
*/
public void getPage(Page page, boolean includePosts) {
final GetPageRequest input = ApiHelper.setAccessCode(new GetPageRequest());
input.session = SessionController.get().sessionForApiCall();
input.page = page;
input.includePosts = Boolean.valueOf(includePosts);
if (getPageRequest != null) {
getPageRequest.cancel();
}
getPageRequest = ApiHelper.createPageClient().getPage(input, new AsyncCallback<GetPageResponse>() {
@Override
public void onSuccess(GetPageResponse output) {
getPageRequest = null;
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new GetPageSuccess(input, output), PageController.this);
}
@Override
public void onFailure(Throwable caught) {
getPageRequest = null;
DefaultEventBus.get().fireEventFromSource(new GetPageFailure(input, caught), PageController.this);
}
});
}
Aggregations