use of org.olat.basesecurity.events.MultiIdentityChosenEvent in project OpenOLAT by OpenOLAT.
the class ImportMemberBySearchController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent e = (SingleIdentityChosenEvent) event;
addToRunContext("keyIdentities", Collections.singletonList(e.getChosenIdentity()));
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
} else if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent e = (MultiIdentityChosenEvent) event;
addToRunContext("keyIdentities", e.getChosenIdentities());
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
} else {
super.event(ureq, source, event);
}
}
use of org.olat.basesecurity.events.MultiIdentityChosenEvent in project openolat by klemens.
the class TaxonomyLevelCompetenceController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (userSearchCtrl == source) {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent singleEvent = (SingleIdentityChosenEvent) event;
Identity choosenIdentity = singleEvent.getChosenIdentity();
if (choosenIdentity != null) {
List<Identity> toAdd = Collections.singletonList(choosenIdentity);
doAddCompetence(toAdd, (TaxonomyCompetenceTypes) userSearchCtrl.getUserObject());
loadModel();
}
} else if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
List<Identity> toAdd = multiEvent.getChosenIdentities();
if (toAdd.size() > 0) {
doAddCompetence(toAdd, (TaxonomyCompetenceTypes) userSearchCtrl.getUserObject());
loadModel();
}
}
cmc.deactivate();
cleanUp();
} else if (confirmDeleteDialog == source) {
if (DialogBoxUIFactory.isOkEvent(event) || DialogBoxUIFactory.isYesEvent(event)) {
@SuppressWarnings("unchecked") List<TaxonomyLevelCompetenceRow> selectedRows = (List<TaxonomyLevelCompetenceRow>) confirmDeleteDialog.getUserObject();
doRemoveCompetences(selectedRows);
}
} else if (editCompetenceCtrl == source) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
loadModel();
tableEl.reset(false, false, true);
}
cmc.deactivate();
cleanUp();
} else if (addCompetencesCallout == source) {
cleanUp();
} else if (cmc == source) {
cleanUp();
}
super.event(ureq, source, event);
}
use of org.olat.basesecurity.events.MultiIdentityChosenEvent in project openolat by klemens.
the class ImportAuthorBySearchController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent e = (SingleIdentityChosenEvent) event;
String key = e.getChosenIdentity().getKey().toString();
addToRunContext("keys", Collections.singletonList(key));
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
} else if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent e = (MultiIdentityChosenEvent) event;
Collection<String> keys = new ArrayList<String>();
for (Identity identity : e.getChosenIdentities()) {
keys.add(identity.getKey().toString());
}
addToRunContext("keys", keys);
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
} else {
super.event(ureq, source, event);
}
}
use of org.olat.basesecurity.events.MultiIdentityChosenEvent in project openolat by klemens.
the class AuthorListController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (cmc == source) {
cleanUp();
} else if (createCtrl == source) {
cmc.deactivate();
if (Event.DONE_EVENT.equals(event)) {
launchEditDescription(ureq, createCtrl.getAddedEntry());
reloadRows();
cleanUp();
} else if (CreateRepositoryEntryController.CREATION_WIZARD.equals(event)) {
doPostCreateWizard(ureq, createCtrl.getAddedEntry(), createCtrl.getHandler());
} else {
cleanUp();
}
} else if (copyCtrl == source) {
cmc.deactivate();
if (event == Event.DONE_EVENT) {
reloadRows();
launchEditDescription(ureq, copyCtrl.getCopiedEntry());
}
cleanUp();
} else if (importCtrl == source) {
cmc.deactivate();
if (Event.DONE_EVENT.equals(event)) {
reloadRows();
launchEditDescription(ureq, importCtrl.getImportedEntry());
}
cleanUp();
} else if (wizardCtrl == source) {
if (event.equals(Event.CHANGED_EVENT) || event.equals(Event.CANCELLED_EVENT)) {
getWindowControl().pop();
RepositoryEntry newEntry = (RepositoryEntry) wizardCtrl.getRunContext().get("authoringNewEntry");
reloadRows();
cleanUp();
launchEditDescription(ureq, newEntry);
}
} else if (searchCtrl == source) {
if (event instanceof SearchEvent) {
SearchEvent se = (SearchEvent) event;
doSearch(ureq, se);
} else if (event == Event.CANCELLED_EVENT) {
searchParams.setResourceTypes(null);
searchParams.setIdAndRefs(null);
searchParams.setAuthor(null);
searchParams.setDisplayname(null);
searchParams.setDescription(null);
searchParams.setOwnedResourcesOnly(false);
searchParams.setResourceUsage(ResourceUsage.all);
searchParams.setLicneseTypeKeys(null);
}
} else if (userSearchCtr == source) {
@SuppressWarnings("unchecked") List<AuthoringEntryRow> rows = (List<AuthoringEntryRow>) userSearchCtr.getUserObject();
if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent mice = (MultiIdentityChosenEvent) event;
doAddOwners(mice.getChosenIdentities(), rows);
} else if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent sice = (SingleIdentityChosenEvent) event;
List<Identity> futureOwners = Collections.singletonList(sice.getChosenIdentity());
doAddOwners(futureOwners, rows);
}
cmc.deactivate();
cleanUp();
} else if (sendMailCtrl == source) {
cmc.deactivate();
cleanUp();
} else if (toolsCtrl == source) {
if (event == Event.DONE_EVENT) {
toolsCalloutCtrl.deactivate();
cleanUp();
}
} else if (referencesCtrl == source) {
if (event == Event.DONE_EVENT) {
toolsCalloutCtrl.deactivate();
cleanUp();
}
} else if (closeCtrl == source) {
if (event == Event.CANCELLED_EVENT) {
cmc.deactivate();
cleanUp();
} else if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
cmc.deactivate();
reloadRows();
cleanUp();
}
} else if (confirmDeleteCtrl == source) {
if (event == Event.CANCELLED_EVENT) {
cmc.deactivate();
cleanUp();
} else if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
cmc.deactivate();
reloadRows();
cleanUp();
}
} else if (copyDialogCtrl == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
@SuppressWarnings("unchecked") List<AuthoringEntryRow> rows = (List<AuthoringEntryRow>) copyDialogCtrl.getUserObject();
doCompleteCopy(rows);
reloadRows();
}
}
super.event(ureq, source, event);
}
use of org.olat.basesecurity.events.MultiIdentityChosenEvent in project openolat by klemens.
the class EPShareListController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == selectGroupCtrl) {
cmc.deactivate();
secureListBox();
if (event instanceof BusinessGroupSelectionEvent) {
BusinessGroupSelectionEvent bge = (BusinessGroupSelectionEvent) event;
List<BusinessGroup> groups = bge.getGroups();
if (groups.size() > 0) {
EPSharePolicyWrapper policyWrapper = (EPSharePolicyWrapper) selectGroupCtrl.getUserObject();
policyWrapper.getGroups().addAll(groups);
initPolicyUI();
}
}
} else if (source.equals(selectUserCtrl)) {
cmc.deactivate();
secureListBox();
EPSharePolicyWrapper policyWrapper = (EPSharePolicyWrapper) selectUserCtrl.getUserObject();
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent foundEvent = (SingleIdentityChosenEvent) event;
Identity chosenIdentity = foundEvent.getChosenIdentity();
if (chosenIdentity != null) {
policyWrapper.getIdentities().add(chosenIdentity);
}
} else if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent foundEvent = (MultiIdentityChosenEvent) event;
List<Identity> chosenIdentities = foundEvent.getChosenIdentities();
if (chosenIdentities != null && !chosenIdentities.isEmpty()) {
policyWrapper.getIdentities().addAll(chosenIdentities);
}
}
initPolicyUI();
} else if (source == cmc) {
cleanUp();
}
super.event(ureq, source, event);
}
Aggregations