Search in sources :

Example 46 with ObjectTypes

use of com.evolveum.midpoint.schema.constants.ObjectTypes in project midpoint by Evolveum.

the class ObjectTypesConverter method getType.

private Set<ObjectTypes> getType(String value) {
    Set<ObjectTypes> set = new HashSet<>();
    if (StringUtils.isEmpty(value)) {
        return set;
    }
    String[] items = value.split(",");
    for (String item : items) {
        if (StringUtils.isEmpty(item)) {
            continue;
        }
        boolean found = false;
        for (ObjectTypes o : ObjectTypes.values()) {
            if (o.name().equalsIgnoreCase(item) || o.getRestType().equalsIgnoreCase(value)) {
                set.add(o);
                found = true;
            }
        }
        if (!found) {
            throw new IllegalArgumentException("Unknown object type " + item);
        }
    }
    return set;
}
Also used : ObjectTypes(com.evolveum.midpoint.schema.constants.ObjectTypes) HashSet(java.util.HashSet)

Aggregations

ObjectTypes (com.evolveum.midpoint.schema.constants.ObjectTypes)46 QName (javax.xml.namespace.QName)16 ArrayList (java.util.ArrayList)11 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)11 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)8 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)8 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)7 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)7 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)6 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)6 List (java.util.List)6 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)5 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)5 AssignmentPopup (com.evolveum.midpoint.gui.api.component.AssignmentPopup)4 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)4 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)4 CountablePanelTab (com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab)3 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)3 PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)3 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)3