use of com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest in project blogwt by billy1380.
the class GeneratedDownloadController method deleteGeneratedDownload.
public void deleteGeneratedDownload(GeneratedDownload generatedDownload) {
final DeleteGeneratedDownloadsRequest input = ApiHelper.setAccessCode(new DeleteGeneratedDownloadsRequest());
input.session = SessionController.get().sessionForApiCall();
input.downloads = Arrays.asList(generatedDownload);
ApiHelper.createDownloadClient().deleteGeneratedDownloads(input, new AsyncCallback<DeleteGeneratedDownloadsResponse>() {
@Override
public void onSuccess(DeleteGeneratedDownloadsResponse output) {
DefaultEventBus.get().fireEventFromSource(new DeleteGeneratedDownloadsSuccess(input, output), GeneratedDownloadController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new DeleteGeneratedDownloadsFailure(input, caught), GeneratedDownloadController.this);
}
});
}
use of com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest in project blogwt by billy1380.
the class DownloadJsonServlet method processAction.
@Override
protected String processAction(String action, JsonObject request) {
String output = "null";
if ("DeleteGeneratedDownloads".equals(action)) {
DeleteGeneratedDownloadsRequest input = new DeleteGeneratedDownloadsRequest();
input.fromJson(request);
output = new DeleteGeneratedDownloadsActionHandler().handle(input).toString();
} else if ("GenerateDownload".equals(action)) {
GenerateDownloadRequest input = new GenerateDownloadRequest();
input.fromJson(request);
output = new GenerateDownloadActionHandler().handle(input).toString();
} else if ("GetGeneratedDownloads".equals(action)) {
GetGeneratedDownloadsRequest input = new GetGeneratedDownloadsRequest();
input.fromJson(request);
output = new GetGeneratedDownloadsActionHandler().handle(input).toString();
}
return output;
}
use of com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest in project blogwt by billy1380.
the class DownloadService method deleteGeneratedDownloads.
public Request deleteGeneratedDownloads(final DeleteGeneratedDownloadsRequest input, final AsyncCallback<DeleteGeneratedDownloadsResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodDeleteGeneratedDownloads, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
DeleteGeneratedDownloadsResponse outputParameter = new DeleteGeneratedDownloadsResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
return handle;
}
Aggregations