Search in sources :

Example 1 with AjaxBootstrapTabbedPanel

use of de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel in project syncope by apache.

the class ReconciliationWidget method buildExecFragment.

private Fragment buildExecFragment() {
    Fragment execFragment = new Fragment("reportResult", "execFragment", this);
    execFragment.setOutputMarkupId(true);
    Pair<List<ProgressBean>, ReconciliationReport> execResult;
    try {
        execResult = parseReconciliationReportExec();
    } catch (Exception e) {
        LOG.error("Could not parse the reconciliation report result", e);
        execResult = Pair.of(Collections.<ProgressBean>emptyList(), new ReconciliationReport(new Date()));
    }
    final List<ProgressBean> progressBeans = execResult.getLeft();
    final ReconciliationReport report = execResult.getRight();
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(new ResourceModel("summary")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new ProgressesPanel(panelId, report.getRun(), progressBeans);
        }
    });
    tabs.add(new AbstractTab(Model.of(AnyTypeKind.USER.name())) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new AnysReconciliationPanel(panelId, report.getUsers(), pageRef);
        }
    });
    tabs.add(new AbstractTab(Model.of(AnyTypeKind.GROUP.name())) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new AnysReconciliationPanel(panelId, report.getGroups(), pageRef);
        }
    });
    for (final Anys anys : report.getAnyObjects()) {
        tabs.add(new AbstractTab(Model.of(anys.getAnyType())) {

            private static final long serialVersionUID = -6815067322125799251L;

            @Override
            public Panel getPanel(final String panelId) {
                return new AnysReconciliationPanel(panelId, anys, pageRef);
            }
        });
    }
    execFragment.add(new AjaxBootstrapTabbedPanel<>("execResult", tabs));
    return execFragment;
}
Also used : ArrayList(java.util.ArrayList) Fragment(org.apache.wicket.markup.html.panel.Fragment) IOException(java.io.IOException) Date(java.util.Date) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) ActionPanel(org.apache.syncope.client.console.wicket.markup.html.form.ActionPanel) DirectoryPanel(org.apache.syncope.client.console.panels.DirectoryPanel) Panel(org.apache.wicket.markup.html.panel.Panel) WizardMgtPanel(org.apache.syncope.client.console.wizards.WizardMgtPanel) ReconciliationReport(org.apache.syncope.client.console.widgets.reconciliation.ReconciliationReport) Anys(org.apache.syncope.client.console.widgets.reconciliation.Anys) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 DirectoryPanel (org.apache.syncope.client.console.panels.DirectoryPanel)1 ActionPanel (org.apache.syncope.client.console.wicket.markup.html.form.ActionPanel)1 Anys (org.apache.syncope.client.console.widgets.reconciliation.Anys)1 ReconciliationReport (org.apache.syncope.client.console.widgets.reconciliation.ReconciliationReport)1 WizardMgtPanel (org.apache.syncope.client.console.wizards.WizardMgtPanel)1 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)1 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)1 Fragment (org.apache.wicket.markup.html.panel.Fragment)1 Panel (org.apache.wicket.markup.html.panel.Panel)1 ResourceModel (org.apache.wicket.model.ResourceModel)1