Search in sources :

Example 6 with SearchAuthorRepositoryEntryViewParams

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.

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 7 with SearchAuthorRepositoryEntryViewParams

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.

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 8 with SearchAuthorRepositoryEntryViewParams

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.

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 9 with SearchAuthorRepositoryEntryViewParams

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.

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)

Example 10 with SearchAuthorRepositoryEntryViewParams

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams in project openolat by klemens.

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)

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