use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project OpenOLAT by OpenOLAT.
the class OverviewAuthoringController method doOpenMyEntries.
private AuthorListController doOpenMyEntries(UserRequest ureq) {
if (myEntriesCtrl == null) {
SearchAuthorRepositoryEntryViewParams searchParams = new SearchAuthorRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setOwnedResourcesOnly(true);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("My", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
myEntriesCtrl = new AuthorListController(ureq, bwControl, "search.my", searchParams, false, true);
listenTo(myEntriesCtrl);
} else if (myDirty) {
myEntriesCtrl.reloadRows();
} else {
myEntriesCtrl.reloadDirtyRows();
}
myDirty = false;
currentCtrl = myEntriesCtrl;
addToHistory(ureq, myEntriesCtrl);
mainVC.put("segmentCmp", myEntriesCtrl.getStackPanel());
return myEntriesCtrl;
}
use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.
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);
}
}
Aggregations