Search in sources :

Example 1 with ServiceSummaryPanel

use of com.evolveum.midpoint.web.page.admin.users.component.ServiceSummaryPanel in project midpoint by Evolveum.

the class FocusPersonasTabPanel method initLayout.

private void initLayout() {
    WebMarkupContainer container = new WebMarkupContainer(ID_PERSONAS_CONTAINER);
    container.setOutputMarkupId(true);
    add(container);
    RepeatingView view = new RepeatingView(ID_PERSONAS_TABLE);
    view.setOutputMarkupId(true);
    container.add(view);
    LoadableModel<List<PrismObject<FocusType>>> personasListModel = loadModel();
    if (personasListModel.getObject() == null || personasListModel.getObject().size() == 0) {
        WebMarkupContainer viewChild = new WebMarkupContainer(view.newChildId());
        viewChild.setOutputMarkupId(true);
        view.add(viewChild);
        WebMarkupContainer emptyContainer = new WebMarkupContainer(ID_PERSONAS_SUMMARY);
        emptyContainer.setOutputMarkupId(true);
        viewChild.add(emptyContainer);
        return;
    }
    Task task = pageBase.createSimpleTask(OPERATION_LOAD_PERSONAS);
    for (PrismObject<FocusType> personaObject : personasListModel.getObject()) {
        ObjectWrapper<FocusType> personaWrapper = ObjectWrapperUtil.createObjectWrapper(WebComponentUtil.getEffectiveName(personaObject, RoleType.F_DISPLAY_NAME), "", personaObject, ContainerStatus.MODIFYING, task, getPageBase());
        WebMarkupContainer personaPanel = new WebMarkupContainer(view.newChildId());
        personaPanel.setOutputMarkupId(true);
        view.add(personaPanel);
        if (personaObject.getCompileTimeClass().equals(UserType.class)) {
            personaPanel.add(new UserSummaryPanel(ID_PERSONAS_SUMMARY, new Model<ObjectWrapper<UserType>>((ObjectWrapper) personaWrapper)));
        } else if (personaObject.getCompileTimeClass().equals(RoleType.class)) {
            personaPanel.add(new RoleSummaryPanel(ID_PERSONAS_SUMMARY, new Model<ObjectWrapper<RoleType>>((ObjectWrapper) personaWrapper)));
        } else if (personaObject.getCompileTimeClass().equals(OrgType.class)) {
            personaPanel.add(new OrgSummaryPanel(ID_PERSONAS_SUMMARY, new Model<ObjectWrapper<OrgType>>((ObjectWrapper) personaWrapper)));
        } else if (personaObject.getCompileTimeClass().equals(ServiceType.class)) {
            personaPanel.add(new ServiceSummaryPanel(ID_PERSONAS_SUMMARY, new Model<ObjectWrapper<ServiceType>>((ObjectWrapper) personaWrapper)));
        }
    }
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ServiceSummaryPanel(com.evolveum.midpoint.web.page.admin.users.component.ServiceSummaryPanel) RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) UserSummaryPanel(com.evolveum.midpoint.web.page.admin.users.component.UserSummaryPanel) Model(org.apache.wicket.model.Model) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) RoleSummaryPanel(com.evolveum.midpoint.web.page.admin.roles.component.RoleSummaryPanel) ObjectWrapper(com.evolveum.midpoint.web.component.prism.ObjectWrapper) ArrayList(java.util.ArrayList) List(java.util.List) OrgSummaryPanel(com.evolveum.midpoint.web.page.admin.users.component.OrgSummaryPanel)

Aggregations

LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 Task (com.evolveum.midpoint.task.api.Task)1 ObjectWrapper (com.evolveum.midpoint.web.component.prism.ObjectWrapper)1 RoleSummaryPanel (com.evolveum.midpoint.web.page.admin.roles.component.RoleSummaryPanel)1 OrgSummaryPanel (com.evolveum.midpoint.web.page.admin.users.component.OrgSummaryPanel)1 ServiceSummaryPanel (com.evolveum.midpoint.web.page.admin.users.component.ServiceSummaryPanel)1 UserSummaryPanel (com.evolveum.midpoint.web.page.admin.users.component.UserSummaryPanel)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 RepeatingView (org.apache.wicket.markup.repeater.RepeatingView)1 Model (org.apache.wicket.model.Model)1