Search in sources :

Example 1 with SearchClause

use of org.apache.syncope.client.console.panels.search.SearchClause 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;
}
Also used : SearchClause(org.apache.syncope.client.console.panels.search.SearchClause) ArrayList(java.util.ArrayList) AbstractSearchPanel(org.apache.syncope.client.console.panels.search.AbstractSearchPanel)

Aggregations

ArrayList (java.util.ArrayList)1 AbstractSearchPanel (org.apache.syncope.client.console.panels.search.AbstractSearchPanel)1 SearchClause (org.apache.syncope.client.console.panels.search.SearchClause)1