Search in sources :

Example 51 with Pool

use of org.olat.modules.qpool.Pool in project openolat by klemens.

the class PoolDAOTest method createPool_withOwner.

@Test
public void createPool_withOwner() {
    Identity id = JunitTestHelper.createAndPersistIdentityAsUser("Pool-owner-" + UUID.randomUUID().toString());
    Pool pool = poolDao.createPool(id, "NGC owned", true);
    Assert.assertNotNull(pool);
    dbInstance.commitAndCloseSession();
}
Also used : QuestionItem2Pool(org.olat.modules.qpool.QuestionItem2Pool) Pool(org.olat.modules.qpool.Pool) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 52 with Pool

use of org.olat.modules.qpool.Pool in project openolat by klemens.

the class QuestionPoolServiceImpl method removeOwners.

@Override
public void removeOwners(List<Identity> owners, List<Pool> pools) {
    if (owners == null || owners.isEmpty() || pools == null || pools.isEmpty()) {
        // nothing to do
        return;
    }
    List<SecurityGroup> secGroups = new ArrayList<SecurityGroup>(pools.size());
    for (Pool pool : pools) {
        SecurityGroup secGroup = ((PoolImpl) pool).getOwnerGroup();
        secGroups.add(secGroup);
    }
    securityManager.removeIdentityFromSecurityGroups(owners, secGroups);
}
Also used : ArrayList(java.util.ArrayList) QuestionItem2Pool(org.olat.modules.qpool.QuestionItem2Pool) Pool(org.olat.modules.qpool.Pool) SecurityGroup(org.olat.basesecurity.SecurityGroup) PoolImpl(org.olat.modules.qpool.model.PoolImpl)

Aggregations

Pool (org.olat.modules.qpool.Pool)52 QuestionItem2Pool (org.olat.modules.qpool.QuestionItem2Pool)32 Test (org.junit.Test)30 Identity (org.olat.core.id.Identity)22 QuestionItem (org.olat.modules.qpool.QuestionItem)20 QItemType (org.olat.modules.qpool.model.QItemType)12 SearchQuestionItemParams (org.olat.modules.qpool.model.SearchQuestionItemParams)12 QuestionItemView (org.olat.modules.qpool.QuestionItemView)10 BusinessGroup (org.olat.group.BusinessGroup)8 ArrayList (java.util.ArrayList)6 List (java.util.List)4 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 TreeNode (org.olat.core.gui.components.tree.TreeNode)4 QuestionItemShort (org.olat.modules.qpool.QuestionItemShort)4 PoolItemsSource (org.olat.modules.qpool.ui.datasource.PoolItemsSource)4 Date (java.util.Date)2 Set (java.util.Set)2 StringTokenizer (java.util.StringTokenizer)2 Document (org.apache.lucene.document.Document)2 StringField (org.apache.lucene.document.StringField)2