use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class RepositoryEntryAuthorQueriesTest method searchViews.
@Test
public void searchViews() {
Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("view-");
dbInstance.commit();
Roles roles = securityManager.getRoles(id);
SearchAuthorRepositoryEntryViewParams params = new SearchAuthorRepositoryEntryViewParams(id, roles);
params.setMarked(Boolean.TRUE);
List<RepositoryEntryAuthorView> views = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
Assert.assertNotNull(views);
}
use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class RepositoryEntryAuthorQueriesTest method searchViews_orderBy.
@Test
public void searchViews_orderBy() {
Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("view-");
dbInstance.commit();
Roles roles = securityManager.getRoles(id);
SearchAuthorRepositoryEntryViewParams params = new SearchAuthorRepositoryEntryViewParams(id, roles);
params.setMarked(Boolean.TRUE);
for (OrderBy orderBy : OrderBy.values()) {
params.setOrderBy(orderBy);
params.setOrderByAsc(true);
List<RepositoryEntryAuthorView> viewAsc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
Assert.assertNotNull(viewAsc);
params.setOrderByAsc(false);
List<RepositoryEntryAuthorView> viewDesc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
Assert.assertNotNull(viewDesc);
}
}
use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class OverviewAuthoringController method doOpenDeletedEntries.
private AuthorListController doOpenDeletedEntries(UserRequest ureq) {
if (deletedEntriesCtrl == null) {
SearchAuthorRepositoryEntryViewParams searchParams = new SearchAuthorRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
if (!isOlatAdmin) {
searchParams.setOwnedResourcesOnly(true);
}
searchParams.setDeleted(true);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Deleted", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
deletedEntriesCtrl = new AuthorDeletedListController(ureq, bwControl, "search.deleted", searchParams, false);
listenTo(deletedEntriesCtrl);
} else if (deletedDirty) {
deletedEntriesCtrl.reloadRows();
} else {
deletedEntriesCtrl.reloadDirtyRows();
}
deletedDirty = false;
currentCtrl = deletedEntriesCtrl;
addToHistory(ureq, deletedEntriesCtrl);
mainVC.put("segmentCmp", deletedEntriesCtrl.getStackPanel());
return deletedEntriesCtrl;
}
use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class OverviewAuthoringController method doOpenMark.
private AuthorListController doOpenMark(UserRequest ureq) {
if (markedCtrl == null) {
SearchAuthorRepositoryEntryViewParams searchParams = new SearchAuthorRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setMarked(Boolean.TRUE);
searchParams.setOwnedResourcesOnly(false);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Favorits", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
markedCtrl = new AuthorListController(ureq, bwControl, "search.mark", searchParams, false, true);
listenTo(markedCtrl);
} else if (favoritDirty) {
markedCtrl.reloadRows();
} else {
markedCtrl.reloadDirtyRows();
}
favoritDirty = false;
currentCtrl = markedCtrl;
addToHistory(ureq, markedCtrl);
mainVC.put("segmentCmp", markedCtrl.getStackPanel());
return markedCtrl;
}
use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class OverviewAuthoringController method doSearchEntries.
private AuthorListController doSearchEntries(UserRequest ureq) {
if (searchEntriesCtrl == null) {
SearchAuthorRepositoryEntryViewParams searchParams = new SearchAuthorRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setOwnedResourcesOnly(false);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Search", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
searchEntriesCtrl = new AuthorListController(ureq, bwControl, "search.generic", searchParams, true, false);
listenTo(searchEntriesCtrl);
}
currentCtrl = searchEntriesCtrl;
addToHistory(ureq, searchEntriesCtrl);
mainVC.put("segmentCmp", searchEntriesCtrl.getStackPanel());
return searchEntriesCtrl;
}
Aggregations