use of org.olat.group.model.BusinessGroupQueryParams in project openolat by klemens.
the class SelectOwnedBusinessGroupController method getSearchParams.
@Override
protected BusinessGroupQueryParams getSearchParams(SearchEvent event) {
BusinessGroupQueryParams params = new BusinessGroupQueryParams(true, false);
params.setWaiting(false);
return params;
}
use of org.olat.group.model.BusinessGroupQueryParams in project openolat by klemens.
the class SelectSearchBusinessGroupController method getSearchParams.
@Override
protected BusinessGroupQueryParams getSearchParams(SearchEvent event) {
BusinessGroupQueryParams params = event.convertToBusinessGroupQueriesParams();
// security
if (restricted && !params.isAttendee() && !params.isOwner() && !params.isWaiting() && (params.getPublicGroups() == null || !params.getPublicGroups().booleanValue())) {
params.setOwner(true);
params.setAttendee(true);
params.setWaiting(true);
}
return params;
}
use of org.olat.group.model.BusinessGroupQueryParams in project openolat by klemens.
the class SelectSearchBusinessGroupController method getDefaultSearchParams.
@Override
protected BusinessGroupQueryParams getDefaultSearchParams() {
BusinessGroupQueryParams params = new BusinessGroupQueryParams();
// security
if (restricted) {
params.setOwner(true);
params.setAttendee(true);
params.setWaiting(true);
}
return params;
}
use of org.olat.group.model.BusinessGroupQueryParams in project openolat by klemens.
the class CourseBusinessGroupListController method getDefaultSearchParams.
@Override
protected BusinessGroupQueryParams getDefaultSearchParams() {
BusinessGroupQueryParams params = new BusinessGroupQueryParams();
params.setRepositoryEntry(re);
return params;
}
use of org.olat.group.model.BusinessGroupQueryParams in project OpenOLAT by OpenOLAT.
the class BusinessGroupDAOTest method findBusinessGroupsWithResources.
@Test
public void findBusinessGroupsWithResources() {
// create a group attach to a resource
Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("bg-search-10");
Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("marker-");
RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
BusinessGroup group1 = businessGroupDao.createAndPersist(owner, "rsrc-grp-1", "rsrc-grp-1-desc", 0, 5, true, false, true, false, false);
BusinessGroup group2 = businessGroupDao.createAndPersist(owner, "rsrc-grp-2", "rsrc-grp-2-desc", 0, 5, true, false, true, false, false);
businessGroupRelationDao.addRelationToResource(group1, re);
dbInstance.commitAndCloseSession();
// check the same with the views
// check the search function with resources
BusinessGroupQueryParams queryWithParams = new BusinessGroupQueryParams();
queryWithParams.setResources(Boolean.TRUE);
List<BusinessGroupRow> groupViewWith = businessGroupDao.searchBusinessGroupsWithMemberships(queryWithParams, id);
Assert.assertNotNull(groupViewWith);
Assert.assertFalse(groupViewWith.isEmpty());
Assert.assertTrue(contains(groupViewWith, group1));
// check the search function without resources
BusinessGroupQueryParams queryWithoutParams = new BusinessGroupQueryParams();
queryWithoutParams.setResources(Boolean.FALSE);
List<BusinessGroupRow> groupViewWithout = businessGroupDao.searchBusinessGroupsWithMemberships(queryWithoutParams, id);
Assert.assertNotNull(groupViewWithout);
Assert.assertFalse(groupViewWithout.isEmpty());
Assert.assertTrue(contains(groupViewWithout, group2));
}
Aggregations