Search in sources :

Example 1 with AssignmentCatalogPanel

use of com.evolveum.midpoint.web.component.assignment.AssignmentCatalogPanel in project midpoint by Evolveum.

the class PageAssignmentShoppingKart method initMainPanel.

private Component initMainPanel() {
    List<AssignmentViewType> viewTypeList = getAssignmentViewList();
    AssignmentViewType defaultViewType = getDefaultAssignmentViewType();
    if (viewTypeList == null || viewTypeList.size() == 0) {
        viewTypeList = new ArrayList<>(Arrays.asList(AssignmentViewType.values()));
    }
    if (defaultViewType != null && !viewTypeList.contains(defaultViewType)) {
        viewTypeList.add(defaultViewType);
    } else if (defaultViewType == null) {
        if (viewTypeList.size() == 1) {
            defaultViewType = viewTypeList.get(0);
        } else {
            if (StringUtils.isEmpty(catalogOid) && AssignmentViewType.ROLE_CATALOG_VIEW.getUri().equals(viewTypeList.get(0).getUri())) {
                defaultViewType = viewTypeList.get(1);
            } else {
                defaultViewType = viewTypeList.get(0);
            }
        }
    }
    AssignmentCatalogPanel panel = new AssignmentCatalogPanel(ID_MAIN_PANEL, catalogOid, defaultViewType, viewTypeList, PageAssignmentShoppingKart.this);
    panel.setOutputMarkupId(true);
    return panel;
}
Also used : AssignmentCatalogPanel(com.evolveum.midpoint.web.component.assignment.AssignmentCatalogPanel) AssignmentViewType(com.evolveum.midpoint.web.page.self.dto.AssignmentViewType)

Aggregations

AssignmentCatalogPanel (com.evolveum.midpoint.web.component.assignment.AssignmentCatalogPanel)1 AssignmentViewType (com.evolveum.midpoint.web.page.self.dto.AssignmentViewType)1