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));
}
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));
}
}
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");
}
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()));
}
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);
}
}
Aggregations