1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.console.clientapps;
20
21 import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
22 import java.util.ArrayList;
23 import java.util.List;
24 import org.apache.syncope.client.console.rest.ClientAppRestClient;
25 import org.apache.syncope.common.lib.types.ClientAppType;
26 import org.apache.wicket.PageReference;
27 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
28 import org.apache.wicket.extensions.markup.html.tabs.ITab;
29 import org.apache.wicket.markup.html.panel.Panel;
30 import org.apache.wicket.model.Model;
31 import org.apache.wicket.spring.injection.annot.SpringBean;
32
33 public class ClientApps extends Panel {
34
35 private static final long serialVersionUID = 5755172996408318813L;
36
37 @SpringBean
38 protected ClientAppRestClient clientAppRestClient;
39
40 public ClientApps(final String id, final PageReference pageRef) {
41 super(id);
42
43 add(new AjaxBootstrapTabbedPanel<>("clientApps", buildTabList(pageRef)));
44 }
45
46 protected List<ITab> buildTabList(final PageReference pageRef) {
47 List<ITab> tabs = new ArrayList<>(3);
48
49 tabs.add(new AbstractTab(Model.of(ClientAppType.CASSP.name())) {
50
51 private static final long serialVersionUID = 5211692813425391144L;
52
53 @Override
54 public Panel getPanel(final String panelId) {
55 return new CASSPDirectoryPanel(panelId, clientAppRestClient, pageRef);
56 }
57 });
58
59 tabs.add(new AbstractTab(Model.of(ClientAppType.SAML2SP.name())) {
60
61 private static final long serialVersionUID = 5211692813425391144L;
62
63 @Override
64 public Panel getPanel(final String panelId) {
65 return new SAML2SPDirectoryPanel(panelId, clientAppRestClient, pageRef);
66 }
67 });
68
69 tabs.add(new AbstractTab(Model.of(ClientAppType.OIDCRP.name())) {
70
71 private static final long serialVersionUID = 5211692813425391144L;
72
73 @Override
74 public Panel getPanel(final String panelId) {
75 return new OIDCRPDirectoryPanel(panelId, clientAppRestClient, pageRef);
76 }
77 });
78
79 return tabs;
80 }
81 }