use of org.apache.syncope.client.console.panels.search.AbstractSearchPanel in project syncope by apache.
the class AnyPanel method getSearchPanel.
private AbstractSearchPanel getSearchPanel(final String id) {
final AbstractSearchPanel panel;
final List<SearchClause> clauses = new ArrayList<>();
final SearchClause clause = new SearchClause();
clauses.add(clause);
switch(anyTypeTO.getKind()) {
case USER:
clause.setComparator(SearchClause.Comparator.EQUALS);
clause.setType(SearchClause.Type.ATTRIBUTE);
clause.setProperty("username");
panel = new UserSearchPanel.Builder(new ListModel<>(clauses)).required(true).enableSearch().build(id);
break;
case GROUP:
clause.setComparator(SearchClause.Comparator.EQUALS);
clause.setType(SearchClause.Type.ATTRIBUTE);
clause.setProperty("name");
panel = new GroupSearchPanel.Builder(new ListModel<>(clauses)).required(true).enableSearch().build(id);
break;
case ANY_OBJECT:
clause.setComparator(SearchClause.Comparator.EQUALS);
clause.setType(SearchClause.Type.ATTRIBUTE);
clause.setProperty("name");
panel = new AnyObjectSearchPanel.Builder(anyTypeTO.getKey(), new ListModel<>(clauses)).required(true).enableSearch().build(id);
break;
default:
panel = null;
}
return panel;
}
Aggregations