use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class ConfigLoader method load.
@Override
public void load(final PageId pageId, final PageState place, final AsyncCallback<Page> callback) {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess() {
final Page page = pageProviders.get(pageId).get();
if (page == null) {
callback.onFailure(new Exception("ConfigLoader didn't know how to handle " + place.toString()));
} else if (page instanceof DbPage) {
dispatch.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(SchemaDTO result) {
DbPageState dbPlace = (DbPageState) place;
((DbPage) page).go(result.getDatabaseById(dbPlace.getDatabaseId()));
callback.onSuccess(page);
}
});
} else {
page.navigate(place);
callback.onSuccess(page);
}
}
});
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class DetailTab method setSite.
public void setSite(final SiteDTO site) {
content.setHtml(I18N.CONSTANTS.loading());
dispatcher.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(SchemaDTO result) {
render(result, site);
}
});
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class PrintDataEntryForm method print.
public void print(final int activityId) {
setVisible(true);
dispatcher.execute(new GetSchema(), new MaskingAsyncMonitor(this, I18N.CONSTANTS.loading()), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
showError(caught);
}
@Override
public void onSuccess(SchemaDTO result) {
renderForm(activityId, result);
}
});
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class ShareReportDialog method show.
public void show(ReportMetadataDTO metadata) {
super.show();
BatchCommand batch = new BatchCommand();
batch.add(new GetReportModel(metadata.getId()));
batch.add(new GetSchema());
batch.add(new GetReportVisibility(metadata.getId()));
dispatcher.execute(batch, new MaskingAsyncMonitor(grid, I18N.CONSTANTS.loading()), new AsyncCallback<BatchResult>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(BatchResult batch) {
currentReport = ((ReportDTO) batch.getResult(0)).getReport();
populateGrid((SchemaDTO) batch.getResult(1), (ReportVisibilityResult) batch.getResult(2));
}
});
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class ShareReportDialog method show.
public void show(final Report report) {
super.show();
this.currentReport = report;
// we need to combine the databases which already have visiblity with
// those
// that could potentially be added
BatchCommand batch = new BatchCommand();
batch.add(new GetSchema());
batch.add(new GetReportVisibility(currentReport.getId()));
dispatcher.execute(batch, new MaskingAsyncMonitor(grid, I18N.CONSTANTS.loading()), new AsyncCallback<BatchResult>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(BatchResult batch) {
populateGrid((SchemaDTO) batch.getResult(0), (ReportVisibilityResult) batch.getResult(1));
}
});
}
Aggregations