Search in sources :

Example 11 with SearchAuthorRepositoryEntryViewParams

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;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) SearchAuthorRepositoryEntryViewParams(org.olat.repository.model.SearchAuthorRepositoryEntryViewParams)

Example 12 with SearchAuthorRepositoryEntryViewParams

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);
    }
}
Also used : OrderBy(org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy) RepositoryEntryAuthorView(org.olat.repository.RepositoryEntryAuthorView) Roles(org.olat.core.id.Roles) Identity(org.olat.core.id.Identity) SearchAuthorRepositoryEntryViewParams(org.olat.repository.model.SearchAuthorRepositoryEntryViewParams) Test(org.junit.Test)

Aggregations

SearchAuthorRepositoryEntryViewParams (org.olat.repository.model.SearchAuthorRepositoryEntryViewParams)12 WindowControl (org.olat.core.gui.control.WindowControl)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 Test (org.junit.Test)4 Identity (org.olat.core.id.Identity)4 Roles (org.olat.core.id.Roles)4 RepositoryEntryAuthorView (org.olat.repository.RepositoryEntryAuthorView)4 OrderBy (org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy)2