Search in sources :

Example 1 with Content

use of org.activityinfo.shared.report.content.Content in project activityinfo by bedatadriven.

the class ReportPortlet method onModelLoad.

private void onModelLoad(ReportDTO dto) {
    Report report = dto.getReport();
    if (report.getElements().isEmpty()) {
        removeAll();
        add(new Label("The report is empty"));
        return;
    }
    final ReportElement element = report.getElement(0);
    final ReportView view = createView(element);
    if (view == null) {
        removeAll();
        add(new Label("Unsupport report type"));
        layout();
        return;
    }
    dispatcher.execute(new GenerateElement<Content>(element), new AsyncCallback<Content>() {

        @Override
        public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onSuccess(Content result) {
            element.setContent(result);
            view.show(element);
            removeAll();
            add(view.asComponent());
            layout();
        }
    });
}
Also used : Report(org.activityinfo.shared.report.model.Report) Content(org.activityinfo.shared.report.content.Content) Label(com.extjs.gxt.ui.client.widget.Label) MapReportView(org.activityinfo.client.report.view.MapReportView) ReportView(org.activityinfo.client.report.view.ReportView) PivotChartReportElement(org.activityinfo.shared.report.model.PivotChartReportElement) PivotTableReportElement(org.activityinfo.shared.report.model.PivotTableReportElement) MapReportElement(org.activityinfo.shared.report.model.MapReportElement) ReportElement(org.activityinfo.shared.report.model.ReportElement)

Aggregations

Label (com.extjs.gxt.ui.client.widget.Label)1 MapReportView (org.activityinfo.client.report.view.MapReportView)1 ReportView (org.activityinfo.client.report.view.ReportView)1 Content (org.activityinfo.shared.report.content.Content)1 MapReportElement (org.activityinfo.shared.report.model.MapReportElement)1 PivotChartReportElement (org.activityinfo.shared.report.model.PivotChartReportElement)1 PivotTableReportElement (org.activityinfo.shared.report.model.PivotTableReportElement)1 Report (org.activityinfo.shared.report.model.Report)1 ReportElement (org.activityinfo.shared.report.model.ReportElement)1