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