use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class OrgTreeProvider method createObjectWrapper.
private SelectableBean<OrgType> createObjectWrapper(SelectableBean<OrgType> parent, PrismObject<OrgType> unit) {
if (unit == null) {
return null;
}
//todo relation [lazyman]
// OrgTreeDto orgDto = new OrgTreeDto(parent, unit);
OrgType org = unit.asObjectable();
if (parent != null) {
org.getParentOrg().clear();
org.getParentOrg().add(parent.getValue());
}
SelectableBean<OrgType> orgDto = new SelectableBean<OrgType>(org);
orgDto.getMenuItems().addAll(createInlineMenuItems(orgDto.getValue()));
return orgDto;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class MultipleAssignmentSelector method applyQueryToListProvider.
private List<AssignmentEditorDto> applyQueryToListProvider(ObjectQuery query, List<AssignmentEditorDto> providerList) {
ObjectDataProvider temporaryProvider = new ObjectDataProvider(MultipleAssignmentSelector.this, type);
List<AssignmentEditorDto> displayAssignmentsList = new ArrayList<>();
temporaryProvider.setQuery(query);
Iterator it = temporaryProvider.internalIterator(0, temporaryProvider.size());
List<SelectableBean<F>> providerDataList = IteratorUtils.toList(it);
for (AssignmentEditorDto dto : providerList) {
for (SelectableBean<F> providerDataDto : providerDataList) {
F object = providerDataDto.getValue();
if (object != null && object.getOid().equals(dto.getTargetRef().getOid())) {
displayAssignmentsList.add(dto);
break;
}
}
}
return displayAssignmentsList;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageConnectorHosts method initConnectorHostsColumns.
private List<IColumn<ConnectorHostType, String>> initConnectorHostsColumns() {
List<IColumn<ConnectorHostType, String>> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<ConnectorHostType>();
columns.add(column);
column = new LinkColumn<SelectableBean<ConnectorHostType>>(createStringResource("pageResources.connector.name"), "name", "value.name") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ConnectorHostType>> rowModel) {
ConnectorHostType host = rowModel.getObject().getValue();
// resourceDetailsPerformed(target, host.getOid());
}
};
columns.add(column);
columns.add(new PropertyColumn(createStringResource("pageResources.connector.hostname"), "value.hostname"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.port"), "value.port"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.timeout"), "value.timeout"));
columns.add(new CheckBoxColumn(createStringResource("pageResources.connector.protectConnection"), "value.protectConnection"));
InlineMenuHeaderColumn menu = new InlineMenuHeaderColumn(initInlineHostsMenu());
columns.add(menu);
return columns;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ObjectListPanel method getCustomColumnsTransformed.
protected List<IColumn<SelectableBean<O>, String>> getCustomColumnsTransformed(List<GuiObjectColumnType> customColumns) {
List<IColumn<SelectableBean<O>, String>> columns = new ArrayList<IColumn<SelectableBean<O>, String>>();
if (customColumns == null || customColumns.size() == 0) {
return columns;
}
IColumn<SelectableBean<O>, String> column;
for (GuiObjectColumnType customColumn : customColumns) {
if (WebComponentUtil.getElementVisibility(customColumn.getVisibility())) {
if (customColumns.indexOf(customColumn) == 0) {
column = createNameColumn(customColumn.getDisplay() != null && customColumn.getDisplay().getLabel() != null ? Model.of(customColumn.getDisplay().getLabel()) : createStringResource(getItemDisplayName(customColumn)), customColumn.getPath().toString());
} else {
column = new PropertyColumn(customColumn.getDisplay() != null && customColumn.getDisplay().getLabel() != null ? Model.of(customColumn.getDisplay().getLabel()) : createStringResource(getItemDisplayName(customColumn)), null, SelectableBean.F_VALUE + "." + customColumn.getPath());
}
columns.add(column);
}
}
return columns;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ObjectListPanel method searchPerformed.
@SuppressWarnings("deprecation")
private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
BaseSortableDataProvider<SelectableBean<O>> provider = getDataProvider();
// note: we ignore 'query' parameter, as the 'customQuery' already contains its content (MID-3271)
ObjectQuery customQuery = getQuery();
// if (customQuery == null){
// customQuery = query;
// } else {
// if (query != null){
// customQuery.addFilter(query.getFilter());
// }
// }
provider.setQuery(customQuery);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
}
}
Table table = getTable();
table.setCurrentPage(null);
target.add((Component) table);
target.add(parentPage.getFeedbackPanel());
}
Aggregations