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.audit;
20
21 import org.apache.syncope.client.console.rest.AuditRestClient;
22 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
23 import org.apache.syncope.client.ui.commons.panels.ModalPanel;
24 import org.apache.syncope.common.lib.to.EntityTO;
25 import org.apache.syncope.common.lib.types.AuditElements;
26 import org.apache.wicket.ajax.AjaxRequestTarget;
27 import org.apache.wicket.markup.html.panel.Panel;
28
29 public abstract class AuditHistoryModal<T extends EntityTO> extends Panel implements ModalPanel {
30
31 private static final long serialVersionUID = 1066124171682570080L;
32
33 public AuditHistoryModal(
34 final AuditElements.EventCategoryType type,
35 final String category,
36 final T entity,
37 final String auditRestoreEntitlement,
38 final AuditRestClient restClient) {
39
40 super(BaseModal.CONTENT_ID);
41
42 add(new AuditHistoryDetails<>(
43 "history",
44 entity,
45 type,
46 category,
47 AuditHistoryDetails.DEFAULT_EVENTS,
48 auditRestoreEntitlement,
49 restClient) {
50
51 private static final long serialVersionUID = -5311898419151367494L;
52
53 @Override
54 protected void restore(final String json, final AjaxRequestTarget target) {
55 AuditHistoryModal.this.restore(json, target);
56 this.initDiff();
57 target.add(this);
58 }
59 });
60 }
61
62 protected abstract void restore(String json, AjaxRequestTarget target);
63 }