Search in sources :

Example 1 with GetReportModel

use of org.activityinfo.shared.command.GetReportModel 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 2 with GetReportModel

use of org.activityinfo.shared.command.GetReportModel in project activityinfo by bedatadriven.

the class GetReportModelTest method selectReportWithMetadata.

@Test
public void selectReportWithMetadata() {
    setUser(1);
    ReportDTO result = execute(new GetReportModel(3, true));
    assertNotNull(result.getReport());
    assertEquals("Report 3", result.getReport().getTitle());
    assertNotNull(result.getReportMetadataDTO());
    assertEquals("Alex", result.getReportMetadataDTO().getOwnerName());
}
Also used : GetReportModel(org.activityinfo.shared.command.GetReportModel) ReportDTO(org.activityinfo.shared.dto.ReportDTO) Test(org.junit.Test)

Example 3 with GetReportModel

use of org.activityinfo.shared.command.GetReportModel in project activityinfo by bedatadriven.

the class GetReportModelTest method selectReportOnly2.

@Test
public void selectReportOnly2() {
    setUser(1);
    ReportDTO result = execute(new GetReportModel(3, false));
    assertNotNull(result.getReport());
    assertEquals("Report 3", result.getReport().getTitle());
    assertNull(result.getReportMetadataDTO());
}
Also used : GetReportModel(org.activityinfo.shared.command.GetReportModel) ReportDTO(org.activityinfo.shared.dto.ReportDTO) Test(org.junit.Test)

Example 4 with GetReportModel

use of org.activityinfo.shared.command.GetReportModel in project activityinfo by bedatadriven.

the class GetReportModelTest method selectReportOnly.

@Test
public void selectReportOnly() {
    setUser(1);
    ReportDTO result = execute(new GetReportModel(3));
    assertNotNull(result.getReport());
    assertEquals("Report 3", result.getReport().getTitle());
    assertNull(result.getReportMetadataDTO());
}
Also used : GetReportModel(org.activityinfo.shared.command.GetReportModel) ReportDTO(org.activityinfo.shared.dto.ReportDTO) Test(org.junit.Test)

Aggregations

GetReportModel (org.activityinfo.shared.command.GetReportModel)4 ReportDTO (org.activityinfo.shared.dto.ReportDTO)4 Test (org.junit.Test)3 MaskingAsyncMonitor (org.activityinfo.client.dispatch.monitor.MaskingAsyncMonitor)1 BatchCommand (org.activityinfo.shared.command.BatchCommand)1 GetReportVisibility (org.activityinfo.shared.command.GetReportVisibility)1 GetSchema (org.activityinfo.shared.command.GetSchema)1 BatchResult (org.activityinfo.shared.command.result.BatchResult)1 ReportVisibilityResult (org.activityinfo.shared.command.result.ReportVisibilityResult)1 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)1