Search in sources :

Example 1 with MaskingAsyncMonitor

use of org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor 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);
        }
    });
}
Also used : MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor) GetSchema(org.activityinfo.shared.command.GetSchema) SchemaDTO(org.activityinfo.shared.dto.SchemaDTO)

Example 2 with MaskingAsyncMonitor

use of org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor in project activityinfo by bedatadriven.

the class EmailDialog method onButtonPressed.

@Override
protected void onButtonPressed(Button button) {
    if (button.getItemId().equals(OK)) {
        final UpdateReportSubscription update = new UpdateReportSubscription();
        update.setReportId(reportMetadata.getId());
        if (weekly.getValue()) {
            update.setEmailDelivery(EmailDelivery.WEEKLY);
            update.setEmailDay(dayOfWeek.getMappedValue());
        } else if (monthly.getValue()) {
            update.setEmailDelivery(EmailDelivery.MONTHLY);
            update.setEmailDay(dayOfMonth.getMappedValue());
        } else {
            update.setEmailDelivery(EmailDelivery.NONE);
        }
        dispatcher.execute(update, new MaskingAsyncMonitor(this, I18N.CONSTANTS.saving()), new AsyncCallback<VoidResult>() {

            @Override
            public void onFailure(Throwable caught) {
            }

            @Override
            public void onSuccess(VoidResult result) {
                hide();
                reportMetadata.setEmailDelivery(update.getEmailDelivery());
                reportMetadata.setDay(update.getEmailDay());
                callback.onUpdated();
            }
        });
    } else if (button.getItemId().equals(CANCEL)) {
        hide();
    }
}
Also used : UpdateReportSubscription(org.activityinfo.shared.command.UpdateReportSubscription) VoidResult(org.activityinfo.shared.command.result.VoidResult) MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor)

Example 3 with MaskingAsyncMonitor

use of org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor 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));
        }
    });
}
Also used : ReportVisibilityResult(org.activityinfo.shared.command.result.ReportVisibilityResult) GetReportVisibility(org.activityinfo.shared.command.GetReportVisibility) GetReportModel(org.activityinfo.shared.command.GetReportModel) MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor) ReportDTO(org.activityinfo.shared.dto.ReportDTO) BatchCommand(org.activityinfo.shared.command.BatchCommand) BatchResult(org.activityinfo.shared.command.result.BatchResult) GetSchema(org.activityinfo.shared.command.GetSchema) SchemaDTO(org.activityinfo.shared.dto.SchemaDTO)

Example 4 with MaskingAsyncMonitor

use of org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor 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));
        }
    });
}
Also used : ReportVisibilityResult(org.activityinfo.shared.command.result.ReportVisibilityResult) GetReportVisibility(org.activityinfo.shared.command.GetReportVisibility) MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor) BatchCommand(org.activityinfo.shared.command.BatchCommand) BatchResult(org.activityinfo.shared.command.result.BatchResult) GetSchema(org.activityinfo.shared.command.GetSchema) SchemaDTO(org.activityinfo.shared.dto.SchemaDTO)

Example 5 with MaskingAsyncMonitor

use of org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor in project activityinfo by bedatadriven.

the class SearchResultsPage method initializeComponent.

private void initializeComponent() {
    setHeaderVisible(false);
    setLayout(new BorderLayout());
    SearchResources.INSTANCE.searchStyles().ensureInjected();
    loadingMonitor = new MaskingAsyncMonitor(this, I18N.CONSTANTS.busySearching());
}
Also used : BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) MaskingAsyncMonitor(org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor)

Aggregations

MaskingAsyncMonitor (org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor)11 GetSchema (org.activityinfo.shared.command.GetSchema)4 VoidResult (org.activityinfo.shared.command.result.VoidResult)4 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)4 BatchCommand (org.activityinfo.shared.command.BatchCommand)3 BatchResult (org.activityinfo.shared.command.result.BatchResult)3 Record (com.extjs.gxt.ui.client.store.Record)2 ArrayList (java.util.ArrayList)2 GetReportVisibility (org.activityinfo.shared.command.GetReportVisibility)2 UpdateUserPermissions (org.activityinfo.shared.command.UpdateUserPermissions)2 ReportVisibilityResult (org.activityinfo.shared.command.result.ReportVisibilityResult)2 UserPermissionDTO (org.activityinfo.shared.dto.UserPermissionDTO)2 BaseModelData (com.extjs.gxt.ui.client.data.BaseModelData)1 ModelData (com.extjs.gxt.ui.client.data.ModelData)1 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)1 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 List (java.util.List)1 DeleteReport (org.activityinfo.shared.command.DeleteReport)1 GetBaseMaps (org.activityinfo.shared.command.GetBaseMaps)1