use of org.activityinfo.shared.command.result.VoidResult in project activityinfo by bedatadriven.
the class AttachmentsPresenter method onDelete.
public void onDelete() {
DeleteSiteAttachment attachment = new DeleteSiteAttachment();
attachment.setBlobId(view.getSelectedItem());
dispatcher.execute(attachment, new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
// callback.onFailure(caught);
}
@Override
public void onSuccess(VoidResult result) {
view.setActionEnabled(UIActions.DELETE, false);
view.setAttachmentStore(currentSite.getId());
}
});
}
use of org.activityinfo.shared.command.result.VoidResult in project activityinfo by bedatadriven.
the class EmbedDialog method publishActivity.
protected void publishActivity(ActivityDTO activity, final String url) {
Map<String, Object> changes = Maps.newHashMap();
changes.put("published", Published.ALL_ARE_PUBLISHED.getIndex());
UpdateEntity update = new UpdateEntity(activity, changes);
dispatcher.execute(update, new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
MessageBox.alert(I18N.CONSTANTS.embed(), "There was an error encounted on the server while trying to publish the activity", null);
}
@Override
public void onSuccess(VoidResult result) {
show(url);
}
});
}
use of org.activityinfo.shared.command.result.VoidResult in project activityinfo by bedatadriven.
the class MonthlyReportsPanel method save.
private void save() {
ArrayList<UpdateMonthlyReports.Change> changes = new ArrayList<UpdateMonthlyReports.Change>();
for (Record record : store.getModifiedRecords()) {
IndicatorRowDTO report = (IndicatorRowDTO) record.getModel();
for (String property : record.getChanges().keySet()) {
UpdateMonthlyReports.Change change = new UpdateMonthlyReports.Change();
change.setIndicatorId(report.getIndicatorId());
change.setMonth(IndicatorRowDTO.monthForProperty(property));
change.setValue((Double) report.get(property));
changes.add(change);
}
}
service.execute(new UpdateMonthlyReports(currentSiteId, changes), new MaskingAsyncMonitor(this, I18N.CONSTANTS.save()), new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
// handled by monitor
}
@Override
public void onSuccess(VoidResult result) {
}
});
}
use of org.activityinfo.shared.command.result.VoidResult in project activityinfo by bedatadriven.
the class ReportDesignPage method performUpdate.
private void performUpdate(final AsyncMonitor monitor, final AsyncCallback<VoidResult> callback) {
UpdateReportModel updateReport = new UpdateReportModel();
updateReport.setModel(currentModel);
dispatcher.execute(updateReport, monitor, new AsyncCallback<VoidResult>() {
@Override
public void onFailure(final Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(final VoidResult result) {
dirty = false;
callback.onSuccess(result);
}
});
}
use of org.activityinfo.shared.command.result.VoidResult in project activityinfo by bedatadriven.
the class ReportGridPanel method onDashboardClicked.
private void onDashboardClicked(final ReportMetadataDTO model) {
model.setDashboard(!model.isDashboard());
store.update(model);
UpdateReportSubscription update = new UpdateReportSubscription();
update.setReportId(model.getId());
update.setPinnedToDashboard(model.isDashboard());
dispatcher.execute(update, new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(VoidResult result) {
Info.display(I18N.CONSTANTS.saved(), model.isDashboard() ? I18N.MESSAGES.addedToDashboard(model.getTitle()) : I18N.MESSAGES.removedFromDashboard(model.getTitle()));
}
});
}
Aggregations