use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class FocusHistoryPanel method initLayout.
protected void initLayout() {
AuditLogViewerPanel panel = new AuditLogViewerPanel(ID_MAIN_PANEL) {
private static final long serialVersionUID = 1L;
@Override
protected List<IColumn<SelectableBean<AuditEventRecordType>, String>> createColumns() {
List<IColumn<SelectableBean<AuditEventRecordType>, String>> columns = super.createColumns();
IColumn<SelectableBean<AuditEventRecordType>, String> column = new AbstractColumn<SelectableBean<AuditEventRecordType>, String>(new Model<>()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<AuditEventRecordType>>> cellItem, String componentId, IModel<SelectableBean<AuditEventRecordType>> rowModel) {
cellItem.add(new MultiButtonPanel<SelectableBean<AuditEventRecordType>>(componentId, rowModel, 2) {
private static final long serialVersionUID = 1L;
@Override
protected Component createButton(int index, String componentId, IModel<SelectableBean<AuditEventRecordType>> model) {
AjaxIconButton btn = null;
switch(index) {
case 0:
btn = buildDefaultButton(componentId, new Model<>("fa fa-circle-o"), createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectDataTitle"), new Model<>("btn btn-sm " + DoubleButtonColumn.ButtonColorClass.INFO), target -> currentStateButtonClicked(target, getReconstructedObject(getObjectWrapper().getOid(), unwrapModel(model).getEventIdentifier(), getObjectWrapper().getCompileTimeClass()), WebComponentUtil.getLocalizedDate(unwrapModel(model).getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE)));
break;
case 1:
btn = buildDefaultButton(componentId, new Model<>(GuiStyleConstants.CLASS_FILE_TEXT), createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectXmlTitle"), new Model<>("btn btn-sm " + DoubleButtonColumn.ButtonColorClass.SUCCESS), target -> viewObjectXmlButtonClicked(getObjectWrapper().getOid(), unwrapModel(model).getEventIdentifier(), getObjectWrapper().getCompileTimeClass(), WebComponentUtil.getLocalizedDate(unwrapModel(model).getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE)));
break;
}
return btn;
}
});
}
};
columns.add(column);
return columns;
}
@Override
protected ObjectQuery getCustomizeContentQuery() {
return getPageBase().getPrismContext().queryFor(AuditEventRecordType.class).item(AuditEventRecordType.F_TARGET_REF).ref(getObjectWrapper().getOid()).and().item(AuditEventRecordType.F_EVENT_STAGE).eq(AuditEventStageType.EXECUTION).build();
}
@Override
protected String getAuditStorageKey(String collectionNameValue) {
if (StringUtils.isNotEmpty(collectionNameValue)) {
return SessionStorage.KEY_OBJECT_HISTORY_AUDIT_LOG + "." + collectionNameValue + "." + getObjectWrapper().getTypeName().getLocalPart();
}
return SessionStorage.KEY_OBJECT_HISTORY_AUDIT_LOG + "." + getObjectWrapper().getTypeName().getLocalPart();
}
@Override
protected boolean isObjectHistoryPanel() {
return true;
}
};
panel.setOutputMarkupId(true);
add(panel);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageMessageTemplates method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<MessageTemplateType> table = new MainObjectListPanel<>(ID_TABLE, MessageTemplateType.class) {
@Override
protected TableId getTableId() {
return TableId.TABLE_MESSAGE_TEMPLATES;
}
@Override
protected IColumn<SelectableBean<MessageTemplateType>, String> createCheckboxColumn() {
return null;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ObjectHistoryTabPanel method initLayout.
private void initLayout() {
AuditLogViewerPanel panel = new AuditLogViewerPanel(ID_MAIN_PANEL) {
private static final long serialVersionUID = 1L;
@Override
protected List<IColumn<SelectableBean<AuditEventRecordType>, String>> createColumns() {
List<IColumn<SelectableBean<AuditEventRecordType>, String>> columns = super.createColumns();
IColumn<SelectableBean<AuditEventRecordType>, String> column = new AbstractColumn<SelectableBean<AuditEventRecordType>, String>(new Model<>()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<AuditEventRecordType>>> cellItem, String componentId, IModel<SelectableBean<AuditEventRecordType>> rowModel) {
cellItem.add(new MultiButtonPanel<SelectableBean<AuditEventRecordType>>(componentId, rowModel, 2) {
private static final long serialVersionUID = 1L;
@Override
protected Component createButton(int index, String componentId, IModel<SelectableBean<AuditEventRecordType>> model) {
AjaxIconButton btn = null;
switch(index) {
case 0:
btn = buildDefaultButton(componentId, new Model<>("fa fa-circle-o"), createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectDataTitle"), new Model<>("btn btn-sm " + DoubleButtonColumn.ButtonColorClass.INFO), target -> currentStateButtonClicked(target, getReconstructedObject(getObjectWrapper().getOid(), unwrapModel(model).getEventIdentifier(), getObjectWrapper().getCompileTimeClass()), WebComponentUtil.getLocalizedDate(unwrapModel(model).getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE)));
break;
case 1:
btn = buildDefaultButton(componentId, new Model<>(GuiStyleConstants.CLASS_FILE_TEXT), createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectXmlTitle"), new Model<>("btn btn-sm " + DoubleButtonColumn.ButtonColorClass.SUCCESS), target -> viewObjectXmlButtonClicked(getObjectWrapper().getOid(), unwrapModel(model).getEventIdentifier(), getObjectWrapper().getCompileTimeClass(), WebComponentUtil.getLocalizedDate(unwrapModel(model).getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE)));
break;
}
return btn;
}
});
}
};
columns.add(column);
return columns;
}
@Override
protected ObjectQuery getCustomizeContentQuery() {
return getPageBase().getPrismContext().queryFor(AuditEventRecordType.class).item(AuditEventRecordType.F_TARGET_REF).ref(getObjectWrapper().getOid()).and().item(AuditEventRecordType.F_EVENT_STAGE).eq(AuditEventStageType.EXECUTION).build();
}
@Override
protected String getAuditStorageKey(String collectionNameValue) {
if (StringUtils.isNotEmpty(collectionNameValue)) {
return SessionStorage.KEY_OBJECT_HISTORY_AUDIT_LOG + "." + collectionNameValue + "." + getObjectWrapper().getTypeName().getLocalPart();
}
return SessionStorage.KEY_OBJECT_HISTORY_AUDIT_LOG + "." + getObjectWrapper().getTypeName().getLocalPart();
}
@Override
protected boolean isObjectHistoryPanel() {
return true;
}
};
panel.setOutputMarkupId(true);
add(panel);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageArchetypes method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ArchetypeType> table = new MainObjectListPanel<ArchetypeType>(ID_TABLE, ArchetypeType.class) {
@Override
protected TableId getTableId() {
return UserProfileStorage.TableId.TABLE_ARCHETYPES;
}
@Override
protected IColumn<SelectableBean<ArchetypeType>, String> createCheckboxColumn() {
return null;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageAttorneySelection method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
ObjectListPanel<UserType> table = new ObjectListPanel<>(ID_TABLE, UserType.class, Collections.emptyList()) {
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_USER_SELECTION;
}
@Override
protected IColumn<SelectableBean<UserType>, String> createCheckboxColumn() {
return null;
}
@Override
protected IColumn<SelectableBean<UserType>, String> createNameColumn(IModel<String> displayModel, GuiObjectColumnType customColumn, ItemPath itemPath, ExpressionType expression) {
return new ObjectNameColumn<>(createStringResource("ObjectType.name")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<UserType>> rowModel) {
UserType object = rowModel.getObject().getValue();
selectUserPerformed(object.getOid());
}
};
}
@Override
protected List<IColumn<SelectableBean<UserType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<UserType>, String>> columns = new ArrayList<>();
columns.add(createNameColumn(null, null, null, null));
columns.addAll(PageAttorneySelection.this.initColumns());
return columns;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return null;
}
@Override
protected ISelectableDataProvider<UserType, SelectableBean<UserType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getAttorneySelectionQuery(), null);
}
};
table.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_USER_BOX_CSS_CLASSES);
table.setOutputMarkupId(true);
mainForm.add(table);
}
Aggregations