Search in sources :

Example 1 with ProcessedItemDto

use of com.evolveum.midpoint.web.page.admin.server.dto.ProcessedItemDto in project midpoint by Evolveum.

the class ActivitiesItemProcessingPanel method initLayoutNew.

private void initLayoutNew() {
    ListView<ActivityItemProcessingDto> activitiesView = new ListView<>(ID_ACTIVITIES, new PropertyModel<>(getModel(), ActivitiesItemProcessingDto.F_ACTIVITIES)) {

        @Override
        protected void populateItem(ListItem<ActivityItemProcessingDto> listItem) {
            IModel<ActivityItemProcessingDto> itemProcessingModel = listItem.getModel();
            Label summary = new Label(ID_SUMMARY, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_TITLE));
            summary.setOutputMarkupId(true);
            listItem.add(summary);
            Label wallClockThroughput = new Label(ID_WALL_CLOCK_THROUGHPUT, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_WALL_CLOCK_THROUGHPUT));
            summary.setOutputMarkupId(true);
            listItem.add(wallClockThroughput);
            ChartJsPanel<PieChartConfiguration> chartPanel = new ChartJsPanel<>(ID_CHART, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CHART));
            listItem.add(chartPanel);
            chartPanel.add(new VisibleBehaviour(() -> itemProcessingModel.getObject().getTotalCount() > 0));
            PropertyModel<List<ProcessedItemDto>> currentItemsModel = PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CURRENT_ITEMS);
            BoxedTablePanel<ProcessedItemDto> currentItems = new BoxedTablePanel<>(ID_CURRENT_ITEMS, new ListDataProvider<>(ActivitiesItemProcessingPanel.this, currentItemsModel), createCurrentItemsColumns()) {

                @Override
                protected boolean hideFooterIfSinglePage() {
                    return true;
                }

                @Override
                public String getAdditionalBoxCssClasses() {
                    return " box-info ";
                }
            };
            currentItems.setOutputMarkupId(true);
            currentItems.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(currentItemsModel.getObject())));
            listItem.add(currentItems);
            listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SUCCESS_BOX), ID_SUCCESS_ITEM));
            listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_FAILED_BOX), ID_FAILED_ITEM));
            listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SKIP_BOX), ID_SKIPPED_ITEM));
        }
    };
    activitiesView.setOutputMarkupId(true);
    add(activitiesView);
}
Also used : ChartJsPanel(com.evolveum.wicket.chartjs.ChartJsPanel) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) PieChartConfiguration(com.evolveum.wicket.chartjs.PieChartConfiguration) Label(org.apache.wicket.markup.html.basic.Label) ListView(org.apache.wicket.markup.html.list.ListView) ActivityItemProcessingDto(com.evolveum.midpoint.web.page.admin.server.dto.ActivityItemProcessingDto) ArrayList(java.util.ArrayList) List(java.util.List) ListItem(org.apache.wicket.markup.html.list.ListItem) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) ProcessedItemDto(com.evolveum.midpoint.web.page.admin.server.dto.ProcessedItemDto)

Aggregations

BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 ActivityItemProcessingDto (com.evolveum.midpoint.web.page.admin.server.dto.ActivityItemProcessingDto)1 ProcessedItemDto (com.evolveum.midpoint.web.page.admin.server.dto.ProcessedItemDto)1 ChartJsPanel (com.evolveum.wicket.chartjs.ChartJsPanel)1 PieChartConfiguration (com.evolveum.wicket.chartjs.PieChartConfiguration)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Label (org.apache.wicket.markup.html.basic.Label)1 ListItem (org.apache.wicket.markup.html.list.ListItem)1 ListView (org.apache.wicket.markup.html.list.ListView)1