-
Notifications
You must be signed in to change notification settings - Fork 188
/
AuditLogViewerPanel.java
485 lines (427 loc) · 24.3 KB
/
AuditLogViewerPanel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
package com.evolveum.midpoint.web.page.admin.reports.component;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.web.component.AjaxSubmitButton;
import com.evolveum.midpoint.web.component.data.BoxedTablePanel;
import com.evolveum.midpoint.web.component.data.column.LinkColumn;
import com.evolveum.midpoint.web.component.form.ValueChooseWrapperPanel;
import com.evolveum.midpoint.web.component.input.DatePanel;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
import com.evolveum.midpoint.web.component.input.QNameChoiceRenderer;
import com.evolveum.midpoint.web.component.input.TextPanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior;
import com.evolveum.midpoint.web.page.admin.reports.PageAuditLogDetails;
import com.evolveum.midpoint.web.page.admin.reports.dto.AuditEventRecordProvider;
import com.evolveum.midpoint.web.page.admin.reports.dto.AuditSearchDto;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.DateValidator;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventStageType;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventTypeType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.yui.calendar.DateTimeField;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.util.ListModel;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import java.util.*;
/**
* Created by honchar.
*/
public class AuditLogViewerPanel extends BasePanel{
private static final long serialVersionUID = 1L;
private static final String ID_PARAMETERS_PANEL = "parametersPanel";
private static final String ID_TABLE = "table";
private static final String ID_FROM = "fromField";
private static final String ID_TO = "toField";
private static final String ID_INITIATOR_NAME = "initiatorNameField";
private static final String ID_TARGET_NAME = "targetNameField";
private static final String ID_TARGET_NAME_LABEL = "targetNameLabel";
private static final String ID_TARGET_OWNER_NAME = "targetOwnerNameField";
private static final String ID_CHANNEL = "channelField";
private static final String ID_HOST_IDENTIFIER = "hostIdentifierField";
private static final String ID_EVENT_TYPE = "eventTypeField";
private static final String ID_EVENT_STAGE = "eventStageField";
private static final String ID_EVENT_STAGE_LABEL = "eventStageLabel";
private static final String ID_OUTCOME = "outcomeField";
private static final String ID_MAIN_FORM = "mainForm";
private static final String ID_SEARCH_BUTTON = "searchButton";
private static final String ID_FEEDBACK = "feedback";
private static final String OPERATION_RESOLVE_REFENRENCE_NAME = AuditLogViewerPanel.class.getSimpleName()
+ ".resolveReferenceName()";
private IModel<AuditSearchDto> auditSearchDto;
private AuditSearchDto searchDto;
private PageBase pageBase;
public AuditLogViewerPanel(String id, PageBase pageBase){
this(id, pageBase, null);
}
public AuditLogViewerPanel(String id, PageBase pageBase, AuditSearchDto searchDto){
super(id);
this.pageBase = pageBase;
this.searchDto = searchDto;
initAuditSearchModel();
initLayout();
}
private void initAuditSearchModel(){
if (searchDto == null){
searchDto = new AuditSearchDto();
}
auditSearchDto = new Model<AuditSearchDto>(searchDto);
}
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
initParametersPanel(mainForm);
addOrReplaceTable(mainForm);
}
private void initParametersPanel(Form mainForm) {
WebMarkupContainer parametersPanel = new WebMarkupContainer(ID_PARAMETERS_PANEL);
parametersPanel.setOutputMarkupId(true);
mainForm.add(parametersPanel);
PropertyModel<XMLGregorianCalendar> fromModel = new PropertyModel<XMLGregorianCalendar>(
auditSearchDto, AuditSearchDto.F_FROM);
DatePanel from = new DatePanel(ID_FROM, fromModel);
DateValidator dateFromValidator = WebComponentUtil.getRangeValidator(mainForm,
new ItemPath(AuditSearchDto.F_FROM));
dateFromValidator.setMessageKey("AuditLogViewerPanel.dateValidatorMessage");
dateFromValidator.setDateFrom((DateTimeField) from.getBaseFormComponent());
for (FormComponent<?> formComponent : from.getFormComponents()) {
formComponent.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
}
from.setOutputMarkupId(true);
parametersPanel.add(from);
PropertyModel<XMLGregorianCalendar> toModel = new PropertyModel<XMLGregorianCalendar>(auditSearchDto,
AuditSearchDto.F_TO);
DatePanel to = new DatePanel(ID_TO, toModel);
DateValidator dateToValidator = WebComponentUtil.getRangeValidator(mainForm,
new ItemPath(AuditSearchDto.F_FROM));
dateToValidator.setMessageKey("AuditLogViewerPanel.dateValidatorMessage");
dateToValidator.setDateTo((DateTimeField) to.getBaseFormComponent());
for (FormComponent<?> formComponent : to.getFormComponents()) {
formComponent.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
}
to.setOutputMarkupId(true);
parametersPanel.add(to);
PropertyModel<String> hostIdentifierModel = new PropertyModel<String>(auditSearchDto,
AuditSearchDto.F_HOST_IDENTIFIER);
TextPanel<String> hostIdentifier = new TextPanel<String>(ID_HOST_IDENTIFIER, hostIdentifierModel);
hostIdentifier.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
hostIdentifier.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
hostIdentifier.setOutputMarkupId(true);
parametersPanel.add(hostIdentifier);
ListModel<AuditEventTypeType> eventTypeListModel = new ListModel<AuditEventTypeType>(
Arrays.asList(AuditEventTypeType.values()));
PropertyModel<AuditEventTypeType> eventTypeModel = new PropertyModel<AuditEventTypeType>(
auditSearchDto, AuditSearchDto.F_EVENT_TYPE);
DropDownChoicePanel<AuditEventTypeType> eventType = new DropDownChoicePanel<AuditEventTypeType>(
ID_EVENT_TYPE, eventTypeModel, eventTypeListModel,
new EnumChoiceRenderer<AuditEventTypeType>(), true);
eventType.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
eventType.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
eventType.setOutputMarkupId(true);
parametersPanel.add(eventType);
Label eventStageLabel = new Label(ID_EVENT_STAGE_LABEL, pageBase.createStringResource("PageAuditLogViewer.eventStageLabel"));
eventStageLabel.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
return searchDto.getEventStage() == null ||
StringUtils.isEmpty(searchDto.getEventStage().value());
}
});
eventStageLabel.setOutputMarkupId(true);
parametersPanel.add(eventStageLabel);
ListModel<AuditEventStageType> eventStageListModel = new ListModel<AuditEventStageType>(
Arrays.asList(AuditEventStageType.values()));
PropertyModel<AuditEventStageType> eventStageModel = new PropertyModel<AuditEventStageType>(
auditSearchDto, AuditSearchDto.F_EVENT_STAGE);
DropDownChoicePanel<AuditEventStageType> eventStage = new DropDownChoicePanel<AuditEventStageType>(
ID_EVENT_STAGE, eventStageModel, eventStageListModel,
new EnumChoiceRenderer<AuditEventStageType>(), true);
eventStage.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return searchDto.getEventStage() == null ||
StringUtils.isEmpty(searchDto.getEventStage().value());
}
});
eventStage.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
eventStage.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
eventStage.setOutputMarkupId(true);
parametersPanel.add(eventStage);
ListModel<OperationResultStatusType> outcomeListModel = new ListModel<OperationResultStatusType>(
Arrays.asList(OperationResultStatusType.values()));
PropertyModel<OperationResultStatusType> outcomeModel = new PropertyModel<OperationResultStatusType>(
auditSearchDto, AuditSearchDto.F_OUTCOME);
DropDownChoicePanel<OperationResultStatusType> outcome = new DropDownChoicePanel<OperationResultStatusType>(
ID_OUTCOME, outcomeModel, outcomeListModel,
new EnumChoiceRenderer<OperationResultStatusType>(), true);
outcome.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
outcome.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
outcome.setOutputMarkupId(true);
parametersPanel.add(outcome);
List<String> channelList = WebComponentUtil.getChannelList();
List<QName> channelQnameList = new ArrayList<QName>();
for (int i = 0; i < channelList.size(); i++) {
String channel = channelList.get(i);
if (channel != null) {
QName channelQName = QNameUtil.uriToQName(channel);
channelQnameList.add(channelQName);
}
}
ListModel<QName> channelListModel = new ListModel<QName>(channelQnameList);
PropertyModel<QName> channelModel = new PropertyModel<QName>(auditSearchDto,
AuditSearchDto.F_CHANNEL);
DropDownChoicePanel<QName> channel = new DropDownChoicePanel<QName>(ID_CHANNEL, channelModel,
channelListModel, new QNameChoiceRenderer(), true);
channel.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
channel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
channel.setOutputMarkupId(true);
parametersPanel.add(channel);
Collection<Class<? extends UserType>> allowedClasses = new ArrayList<>();
allowedClasses.add(UserType.class);
ValueChooseWrapperPanel<ObjectReferenceType, UserType> chooseInitiatorPanel = new ValueChooseWrapperPanel<ObjectReferenceType, UserType>(
ID_INITIATOR_NAME,
new PropertyModel<ObjectReferenceType>(auditSearchDto, AuditSearchDto.F_INITIATOR_NAME),
allowedClasses) {
@Override
protected void replaceIfEmpty(ObjectType object) {
ObjectReferenceType ort = ObjectTypeUtil.createObjectRef(object);
ort.setTargetName(object.getName());
getModel().setObject(ort);
}
};
parametersPanel.add(chooseInitiatorPanel);
ValueChooseWrapperPanel<ObjectReferenceType, UserType> chooseTargerOwnerPanel = new ValueChooseWrapperPanel<ObjectReferenceType, UserType>(
ID_TARGET_OWNER_NAME,
new PropertyModel<ObjectReferenceType>(auditSearchDto, AuditSearchDto.F_TARGET_OWNER_NAME),
allowedClasses) {
@Override
protected void replaceIfEmpty(ObjectType object) {
ObjectReferenceType ort = ObjectTypeUtil.createObjectRef(object);
ort.setTargetName(object.getName());
getModel().setObject(ort);
}
};
parametersPanel.add(chooseTargerOwnerPanel);
Label targetNameLabel = new Label(ID_TARGET_NAME_LABEL, pageBase.createStringResource("PageAuditLogViewer.targetNameLabel"));
targetNameLabel.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
return searchDto.getTargetName() == null || StringUtils.isEmpty(searchDto.getTargetName().getOid());
}
});
parametersPanel.add(targetNameLabel);
Collection<Class<? extends ObjectType>> allowedClassesAll = new ArrayList<>();
allowedClassesAll.addAll(ObjectTypes.getAllObjectTypes());
ValueChooseWrapperPanel<ObjectReferenceType, ObjectType> chooseTargetPanel = new ValueChooseWrapperPanel<ObjectReferenceType, ObjectType>(
ID_TARGET_NAME,
new PropertyModel<ObjectReferenceType>(auditSearchDto, AuditSearchDto.F_TARGET_NAME),
allowedClassesAll){
@Override
protected void replaceIfEmpty(ObjectType object) {
ObjectReferenceType ort = ObjectTypeUtil.createObjectRef(object);
ort.setTargetName(object.getName());
getModel().setObject(ort);
}
};
chooseTargetPanel.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
return searchDto.getTargetName() == null || StringUtils.isEmpty(searchDto.getTargetName().getOid());
}
});
parametersPanel.add(chooseTargetPanel);
AjaxSubmitButton ajaxButton = new AjaxSubmitButton(ID_SEARCH_BUTTON,
createStringResource("BasicSearchPanel.search")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
Form mainForm = (Form) getParent().getParent();
addOrReplaceTable(mainForm);
getFeedbackPanel().getFeedbackMessages().clear();
target.add(getFeedbackPanel());
target.add(mainForm);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form){
target.add(getFeedbackPanel());
}
};
ajaxButton.setOutputMarkupId(true);
parametersPanel.add(ajaxButton);
}
private void addOrReplaceTable(Form mainForm) {
AuditEventRecordProvider provider = new AuditEventRecordProvider(AuditLogViewerPanel.this) {
private static final long serialVersionUID = 1L;
public Map<String, Object> getParameters() {
Map<String, Object> parameters = new HashMap<String, Object>();
AuditSearchDto search = auditSearchDto.getObject();
parameters.put("from", search.getFrom());
parameters.put("to", search.getTo());
if (search.getChannel() != null) {
parameters.put("channel", QNameUtil.qNameToUri(search.getChannel()));
}
parameters.put("hostIdentifier", search.getHostIdentifier());
if (search.getInitiatorName() != null) {
parameters.put("initiatorName", search.getInitiatorName().getOid());
}
if (search.getTargetOwnerName() != null) {
parameters.put("targetOwnerName", search.getTargetOwnerName().getOid());
}
if (search.getTargetName() != null) {
parameters.put("targetName", search.getTargetName().getOid());
}
parameters.put("eventType", search.getEventType());
parameters.put("eventStage", search.getEventStage());
parameters.put("outcome", search.getOutcome());
return parameters;
}
};
BoxedTablePanel table = new BoxedTablePanel(ID_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_AUDIT_LOG_VIEWER,
(int) pageBase.getItemsPerPage(UserProfileStorage.TableId.PAGE_AUDIT_LOG_VIEWER));
table.setShowPaging(true);
table.setOutputMarkupId(true);
mainForm.addOrReplace(table);
}
private List<IColumn<AuditEventRecordType, String>> initColumns() {
List<IColumn<AuditEventRecordType, String>> columns = new ArrayList<IColumn<AuditEventRecordType, String>>();
IColumn<AuditEventRecordType, String> linkColumn = new LinkColumn<AuditEventRecordType>(
createStringResource("AuditEventRecordType.timestamp"), "timestamp") {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createLinkModel(final IModel<AuditEventRecordType> rowModel){
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
XMLGregorianCalendar time = rowModel.getObject().getTimestamp();
return WebComponentUtil.formatDate(time);
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<AuditEventRecordType> rowModel) {
setResponsePage(new PageAuditLogDetails(rowModel.getObject()));
}
};
columns.add(linkColumn);
PropertyColumn<AuditEventRecordType, String> initiatorRefColumn = new PropertyColumn<AuditEventRecordType, String>(createStringResource("AuditEventRecordType.initiatorRef"),
AuditEventRecordType.F_INITIATOR_REF.getLocalPart()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AuditEventRecordType>> item, String componentId,
IModel<AuditEventRecordType> rowModel) {
AuditEventRecordType auditEventRecordType = (AuditEventRecordType) rowModel.getObject();
createReferenceColumn(auditEventRecordType.getInitiatorRef(), item, componentId);
}
};
columns.add(initiatorRefColumn);
IColumn<AuditEventRecordType, String> eventStageColumn = new PropertyColumn<AuditEventRecordType, String>(
createStringResource("PageAuditLogViewer.eventStageLabel"), "eventStage");
columns.add(eventStageColumn);
IColumn<AuditEventRecordType, String> eventTypeColumn = new PropertyColumn<AuditEventRecordType, String>(
createStringResource("PageAuditLogViewer.eventTypeLabel"), "eventType");
columns.add(eventTypeColumn);
PropertyColumn<AuditEventRecordType, String> targetRefColumn = new PropertyColumn<AuditEventRecordType, String>(createStringResource("AuditEventRecordType.targetRef"),
AuditEventRecordType.F_TARGET_REF.getLocalPart()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AuditEventRecordType>> item, String componentId,
IModel<AuditEventRecordType> rowModel) {
AuditEventRecordType auditEventRecordType = (AuditEventRecordType) rowModel.getObject();
createReferenceColumn(auditEventRecordType.getTargetRef(), item, componentId);
}
};
columns.add(targetRefColumn);
PropertyColumn<AuditEventRecordType, String> targetOwnerRefColumn = new PropertyColumn<AuditEventRecordType, String>(createStringResource("AuditEventRecordType.targetOwnerRef"),
AuditEventRecordType.F_TARGET_OWNER_REF.getLocalPart()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AuditEventRecordType>> item, String componentId,
IModel<AuditEventRecordType> rowModel) {
AuditEventRecordType auditEventRecordType = (AuditEventRecordType) rowModel.getObject();
createReferenceColumn(auditEventRecordType.getTargetOwnerRef(), item, componentId);
}
};
columns.add(targetOwnerRefColumn);
IColumn<AuditEventRecordType, String> channelColumn = new PropertyColumn<AuditEventRecordType, String>(
createStringResource("AuditEventRecordType.channel"), "channel") {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AuditEventRecordType>> item, String componentId,
IModel<AuditEventRecordType> rowModel) {
AuditEventRecordType auditEventRecordType = (AuditEventRecordType) rowModel.getObject();
String channel = auditEventRecordType.getChannel();
if (channel != null) {
QName channelQName = QNameUtil.uriToQName(channel);
String return_ = channelQName.getLocalPart();
item.add(new Label(componentId, return_));
} else {
item.add(new Label(componentId, ""));
}
item.add(new AttributeModifier("style", new Model<String>("width: 10%;")));
}
};
columns.add(channelColumn);
IColumn<AuditEventRecordType, String> outcomeColumn = new PropertyColumn<AuditEventRecordType, String>(
createStringResource("PageAuditLogViewer.outcomeLabel"), "outcome");
columns.add(outcomeColumn);
return columns;
}
// private PropertyColumn<AuditEventRecordType, String> createReferenceColumn(String columnKey,
// QName attributeName) {
// return new PropertyColumn<AuditEventRecordType, String>(createStringResource(columnKey),
// attributeName.getLocalPart()) {
// private static final long serialVersionUID = 1L;
//
// @Override
// public void populateItem(Item<ICellPopulator<AuditEventRecordType>> item, String componentId,
// IModel<AuditEventRecordType> rowModel) {
// AuditEventRecordType auditEventRecordType = (AuditEventRecordType) rowModel.getObject();
// createReferenceColumn(auditEventRecordType.getTargetRef(), item, componentId);
// }
// };
// }
private void createReferenceColumn(ObjectReferenceType ref, Item item, String componentId) {
String name = WebModelServiceUtils.resolveReferenceName(ref, pageBase,
pageBase.createSimpleTask(OPERATION_RESOLVE_REFENRENCE_NAME),
new OperationResult(OPERATION_RESOLVE_REFENRENCE_NAME));
item.add(new Label(componentId, name));
item.add(new AttributeModifier("style", new Model<String>("width: 10%;")));
}
public WebMarkupContainer getFeedbackPanel() {
return (FeedbackPanel) get(pageBase.createComponentPath(ID_MAIN_FORM, ID_FEEDBACK));
}
}