Search in sources :

Example 1 with Queryable

use of org.ovirt.engine.core.common.businessentities.Queryable in project ovirt-engine by oVirt.

the class AdElementListModel method addGroupsToModel.

protected void addGroupsToModel(QueryReturnValue returnValue, Set<String> excludeUsers) {
    for (Queryable item : (Collection<Queryable>) returnValue.getReturnValue()) {
        DirectoryGroup a = (DirectoryGroup) item;
        if (!excludeUsers.contains(a.getId())) {
            // TODO: This is a hack, we should either use DbGroup or reimplement user/group representation in GWT
            DbUser group = new DbUser();
            group.setExternalId(a.getId());
            group.setFirstName(a.getName());
            // $NON-NLS-1$
            group.setLastName("");
            // TODO: Due to group -> DbUser mapping hack we have to use note to represent display name of group
            group.setNote(a.getDisplayName());
            group.setDomain(a.getDirectoryName());
            group.setNamespace(a.getNamespace());
            EntityModel<DbUser> groupEntity = new EntityModel<>();
            groupEntity.setEntity(group);
            getgroups().add(groupEntity);
        }
    }
}
Also used : DirectoryGroup(org.ovirt.engine.core.aaa.DirectoryGroup) Queryable(org.ovirt.engine.core.common.businessentities.Queryable) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) Collection(java.util.Collection) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser)

Example 2 with Queryable

use of org.ovirt.engine.core.common.businessentities.Queryable in project ovirt-engine by oVirt.

the class AdElementListModel method addUsersToModel.

protected void addUsersToModel(QueryReturnValue returnValue, Set<String> excludeUsers) {
    for (Queryable item : (List<Queryable>) returnValue.getReturnValue()) {
        DirectoryUser a = (DirectoryUser) item;
        if (!excludeUsers.contains(a.getId())) {
            EntityModel<DbUser> tempVar2 = new EntityModel<>();
            tempVar2.setEntity(new DbUser(a));
            getusers().add(tempVar2);
        }
    }
}
Also used : DirectoryUser(org.ovirt.engine.core.aaa.DirectoryUser) Queryable(org.ovirt.engine.core.common.businessentities.Queryable) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ArrayList(java.util.ArrayList) List(java.util.List) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser)

Aggregations

Queryable (org.ovirt.engine.core.common.businessentities.Queryable)2 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)2 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 DirectoryGroup (org.ovirt.engine.core.aaa.DirectoryGroup)1 DirectoryUser (org.ovirt.engine.core.aaa.DirectoryUser)1