Search in sources :

Example 21 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project openolat by klemens.

the class QuestionItemDetailsController method doShareItemsWithPool.

private void doShareItemsWithPool(UserRequest ureq, QuestionItemShort item, List<Pool> pools) {
    qpoolService.addItemsInPools(Collections.singletonList(item), pools, false);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent)

Example 22 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.

the class ShareItemSourceOptionController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    boolean editable = editableEl.isOneSelected() && editableEl.isSelected(0);
    int count = source.postImport(items, editable);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
    if (count == 0) {
        showWarning("import.failed");
    } else {
        showInfo("import.success", Integer.toString(count));
    }
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent)

Example 23 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method doDelete.

private void doDelete(UserRequest ureq, List<QuestionItemShort> items) {
    for (QuestionItemShort item : items) {
        QuestionItem qitem = qpoolService.loadItemById(item.getKey());
        QuestionItemAuditLogBuilder builder = qpoolService.createAuditLogBuilder(getIdentity(), Action.DELETE_QUESTION_ITEM);
        builder.withBefore(qitem);
        qpoolService.persist(builder.create());
    }
    qpoolService.deleteItems(items);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_DELETED));
    showInfo("item.deleted");
}
Also used : QuestionItemAuditLogBuilder(org.olat.modules.qpool.QuestionItemAuditLogBuilder) QuestionItemShort(org.olat.modules.qpool.QuestionItemShort) QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent) QuestionItem(org.olat.modules.qpool.QuestionItem)

Example 24 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.

the class QuestionListController method doCreateCollection.

private void doCreateCollection(UserRequest ureq, String name, List<QuestionItemShort> items) {
    QuestionItemCollection coll = qpoolService.createCollection(getIdentity(), name, items);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.COLL_CREATED, coll.getKey()));
}
Also used : QuestionItemCollection(org.olat.modules.qpool.QuestionItemCollection) QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent)

Example 25 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.

the class QuestionListController method event.

@Override
public void event(UserRequest ureq, Component source, Event event) {
    if (source == stackPanel) {
        if (itemCollectionDirty && event instanceof PopEvent) {
            PopEvent pe = (PopEvent) event;
            Controller mainCtrl = pe.getController();
            if (mainCtrl != null && mainCtrl.isControllerListeningTo(this)) {
                reloadData();
                updateStatusFilter();
                fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEMS_RELOADED));
                itemCollectionDirty = false;
            }
        }
    } else {
        super.event(ureq, source, event);
    }
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent) PopEvent(org.olat.core.gui.components.stack.PopEvent) CreateEntryController(org.olat.repository.ui.author.CreateEntryController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) SelectBusinessGroupController(org.olat.group.ui.main.SelectBusinessGroupController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController) DialogBoxController(org.olat.core.gui.control.generic.modal.DialogBoxController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MetadataBulkChangeController(org.olat.modules.qpool.ui.metadata.MetadataBulkChangeController) Controller(org.olat.core.gui.control.Controller)

Aggregations

QPoolEvent (org.olat.modules.qpool.ui.events.QPoolEvent)38 QuestionItem (org.olat.modules.qpool.QuestionItem)6 QuestionItemAuditLogBuilder (org.olat.modules.qpool.QuestionItemAuditLogBuilder)6 QuestionItemShort (org.olat.modules.qpool.QuestionItemShort)6 List (java.util.List)4 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)4 QItemsProcessedEvent (org.olat.modules.qpool.ui.events.QItemsProcessedEvent)4 ArrayList (java.util.ArrayList)2 IdentitiesAddEvent (org.olat.admin.securitygroup.gui.IdentitiesAddEvent)2 IdentitiesRemoveEvent (org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent)2 PopEvent (org.olat.core.gui.components.stack.PopEvent)2 Controller (org.olat.core.gui.control.Controller)2 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 DialogBoxController (org.olat.core.gui.control.generic.modal.DialogBoxController)2 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)2 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)2 Identity (org.olat.core.id.Identity)2 BusinessGroup (org.olat.group.BusinessGroup)2 BusinessGroupSelectionEvent (org.olat.group.model.BusinessGroupSelectionEvent)2