use of com.willshex.blogwt.shared.api.page.call.UpdatePageResponse in project blogwt by billy1380.
the class PageController method updatePage.
/**
* @param page
*/
public void updatePage(Page page) {
final UpdatePageRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new UpdatePageRequest())).page(page);
ApiHelper.createPageClient().updatePage(input, new AsyncCallback<UpdatePageResponse>() {
@Override
public void onSuccess(UpdatePageResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new UpdatePageSuccess(input, output), PageController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new UpdatePageFailure(input, caught), PageController.this);
}
});
}
use of com.willshex.blogwt.shared.api.page.call.UpdatePageResponse in project blogwt by billy1380.
the class PageService method updatePage.
public Request updatePage(UpdatePageRequest input, AsyncSuccess<UpdatePageRequest, UpdatePageResponse> onSuccess, AsyncFailure<UpdatePageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodUpdatePage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdatePageResponse outputParameter = new UpdatePageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodUpdatePage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
});
onCallStart(PageService.this, PageMethodUpdatePage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
return handle;
}
Aggregations