Search in sources :

Example 6 with ReportDTO

use of org.activityinfo.legacy.shared.model.ReportDTO in project activityinfo by bedatadriven.

the class ShareReportDialog method show.

public void show(ReportMetadataDTO metadata) {
    super.show();
    dispatcher.execute(new GetReportModel(metadata.getId()), new MaskingAsyncMonitor(grid, I18N.CONSTANTS.loading()), new SuccessCallback<ReportDTO>() {

        @Override
        public void onSuccess(ReportDTO reportDTO) {
            show(reportDTO.getReport());
        }
    });
}
Also used : MaskingAsyncMonitor(org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor) ReportDTO(org.activityinfo.legacy.shared.model.ReportDTO)

Example 7 with ReportDTO

use of org.activityinfo.legacy.shared.model.ReportDTO in project activityinfo by bedatadriven.

the class GenerateDashboardElementHandler method execute.

@Override
public CommandResult execute(GenerateDashboardElement cmd, User user) throws CommandException {
    ReportDTO report = dispatcher.execute(new GetReportModel(cmd.getReportId()));
    if (report.getReport().getElements().isEmpty()) {
        return new TextReportElement("The report is empty");
    } else {
        ReportElement element = report.getReport().getElements().get(0);
        element.setContent(generator.generateElement(user, element, null, new DateRange()));
        return element;
    }
}
Also used : DateRange(org.activityinfo.legacy.shared.reports.model.DateRange) GetReportModel(org.activityinfo.legacy.shared.command.GetReportModel) ReportDTO(org.activityinfo.legacy.shared.model.ReportDTO) ReportElement(org.activityinfo.legacy.shared.reports.model.ReportElement) TextReportElement(org.activityinfo.legacy.shared.reports.model.TextReportElement) TextReportElement(org.activityinfo.legacy.shared.reports.model.TextReportElement)

Example 8 with ReportDTO

use of org.activityinfo.legacy.shared.model.ReportDTO 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.legacy.shared.command.GetReportModel) ReportDTO(org.activityinfo.legacy.shared.model.ReportDTO) Test(org.junit.Test)

Example 9 with ReportDTO

use of org.activityinfo.legacy.shared.model.ReportDTO 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.legacy.shared.command.GetReportModel) ReportDTO(org.activityinfo.legacy.shared.model.ReportDTO) Test(org.junit.Test)

Aggregations

ReportDTO (org.activityinfo.legacy.shared.model.ReportDTO)9 GetReportModel (org.activityinfo.legacy.shared.command.GetReportModel)5 Test (org.junit.Test)4 Report (org.activityinfo.legacy.shared.reports.model.Report)3 ReportElement (org.activityinfo.legacy.shared.reports.model.ReportElement)3 PivotReportElement (org.activityinfo.legacy.shared.reports.model.PivotReportElement)2 AuthenticatedUser (org.activityinfo.legacy.shared.AuthenticatedUser)1 DateRange (org.activityinfo.legacy.shared.reports.model.DateRange)1 TextReportElement (org.activityinfo.legacy.shared.reports.model.TextReportElement)1 ReportDefinition (org.activityinfo.server.database.hibernate.entity.ReportDefinition)1 MaskingAsyncMonitor (org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor)1