use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class PoolsAdminController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == poolEditCtrl) {
if (event == Event.DONE_EVENT) {
reloadModel();
fireEvent(ureq, new QPoolEvent(QPoolEvent.POOL_CREATED));
}
cmc.deactivate();
cleanUp();
} else if (source == groupCtrl) {
Pool selectedPool = (Pool) groupCtrl.getUserObject();
if (event instanceof IdentitiesAddEvent) {
IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent) event;
List<Identity> list = identitiesAddedEvent.getAddIdentities();
qpoolService.addOwners(list, Collections.singletonList(selectedPool));
identitiesAddedEvent.getAddedIdentities().addAll(list);
} else if (event instanceof IdentitiesRemoveEvent) {
IdentitiesRemoveEvent identitiesRemoveEvent = (IdentitiesRemoveEvent) event;
List<Identity> list = identitiesRemoveEvent.getRemovedIdentities();
qpoolService.removeOwners(list, Collections.singletonList(selectedPool));
}
} else if (source == confirmDeleteCtrl) {
if (DialogBoxUIFactory.isOkEvent(event) || DialogBoxUIFactory.isYesEvent(event)) {
Pool pool = (Pool) confirmDeleteCtrl.getUserObject();
doDelete(ureq, pool);
}
} else if (source == cmc) {
cleanUp();
}
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project OpenOLAT by OpenOLAT.
the class QuestionsController method postDelete.
private void postDelete(UserRequest ureq) {
listCtrl.reset();
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 ShareItemOptionController method formOK.
@Override
protected void formOK(UserRequest ureq) {
boolean editable = editableEl.isOneSelected() && editableEl.isSelected(0);
if (groups != null && !groups.isEmpty()) {
qpoolService.shareItemsWithGroups(items, groups, editable);
}
if (pools != null && !pools.isEmpty()) {
qpoolService.addItemsInPools(items, pools, editable);
}
fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
}
use of org.olat.modules.qpool.ui.events.QPoolEvent in project openolat by klemens.
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 klemens.
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