Search in sources :

Example 1 with SearchAuthorRepositoryEntryViewParams

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);
}
Also used : 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)

Example 2 with SearchAuthorRepositoryEntryViewParams

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);
    }
}
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)

Example 3 with SearchAuthorRepositoryEntryViewParams

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

Example 4 with SearchAuthorRepositoryEntryViewParams

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

Example 5 with SearchAuthorRepositoryEntryViewParams

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

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