use of org.olat.admin.user.UserAdminController in project openolat by klemens.
the class UserAdminMainController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == contentCtr) {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent userChoosenEvent = (SingleIdentityChosenEvent) event;
Identity identity = userChoosenEvent.getChosenIdentity();
// cleanup old userAdminCtr controller
removeAsListenerAndDispose(userAdminCtr);
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Identity.class, identity.getKey());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl;
if (contentCtr instanceof UsermanagerUserSearchController) {
UsermanagerUserSearchController ctrl = (UsermanagerUserSearchController) contentCtr;
WindowControl tableControl = ctrl.getTableControl();
if (tableControl == null) {
tableControl = ctrl.getWindowControlForDebug();
}
bwControl = addToHistory(ureq, ores, null, tableControl, true);
} else {
bwControl = addToHistory(ureq, ores, null, contentCtr.getWindowControlForDebug(), true);
}
userAdminCtr = new UserAdminController(ureq, bwControl, identity);
listenTo(userAdminCtr);
// activate a special pane in the tabbed pane when set
if (activatePaneInDetailView != null) {
List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(activatePaneInDetailView);
userAdminCtr.activate(ureq, entries, null);
}
content.setContent(userAdminCtr.getInitialComponent());
// deactivate back button for user create controller, kames no sense there
if (contentCtr instanceof UserCreateController) {
userAdminCtr.setBackButtonEnabled(false);
} else {
userAdminCtr.setBackButtonEnabled(true);
}
}
} else if (source == userAdminCtr) {
if (event == Event.BACK_EVENT) {
Identity editedIdentity = userAdminCtr.getEditedIdentity();
removeAsListenerAndDispose(userAdminCtr);
userAdminCtr = null;
// to display correct values of identity
if (contentCtr instanceof UsermanagerUserSearchController) {
UsermanagerUserSearchController userSearchCtr = (UsermanagerUserSearchController) contentCtr;
userSearchCtr.reloadFoundIdentity(editedIdentity);
addToHistory(ureq, userSearchCtr);
}
content.setContent(contentCtr.getInitialComponent());
}
}
}
use of org.olat.admin.user.UserAdminController in project OpenOLAT by OpenOLAT.
the class UserAdminMainController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == contentCtr) {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent userChoosenEvent = (SingleIdentityChosenEvent) event;
Identity identity = userChoosenEvent.getChosenIdentity();
// cleanup old userAdminCtr controller
removeAsListenerAndDispose(userAdminCtr);
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Identity.class, identity.getKey());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl;
if (contentCtr instanceof UsermanagerUserSearchController) {
UsermanagerUserSearchController ctrl = (UsermanagerUserSearchController) contentCtr;
WindowControl tableControl = ctrl.getTableControl();
if (tableControl == null) {
tableControl = ctrl.getWindowControlForDebug();
}
bwControl = addToHistory(ureq, ores, null, tableControl, true);
} else {
bwControl = addToHistory(ureq, ores, null, contentCtr.getWindowControlForDebug(), true);
}
userAdminCtr = new UserAdminController(ureq, bwControl, identity);
listenTo(userAdminCtr);
// activate a special pane in the tabbed pane when set
if (activatePaneInDetailView != null) {
List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(activatePaneInDetailView);
userAdminCtr.activate(ureq, entries, null);
}
content.setContent(userAdminCtr.getInitialComponent());
// deactivate back button for user create controller, kames no sense there
if (contentCtr instanceof UserCreateController) {
userAdminCtr.setBackButtonEnabled(false);
} else {
userAdminCtr.setBackButtonEnabled(true);
}
}
} else if (source == userAdminCtr) {
if (event == Event.BACK_EVENT) {
Identity editedIdentity = userAdminCtr.getEditedIdentity();
removeAsListenerAndDispose(userAdminCtr);
userAdminCtr = null;
// to display correct values of identity
if (contentCtr instanceof UsermanagerUserSearchController) {
UsermanagerUserSearchController userSearchCtr = (UsermanagerUserSearchController) contentCtr;
userSearchCtr.reloadFoundIdentity(editedIdentity);
addToHistory(ureq, userSearchCtr);
}
content.setContent(contentCtr.getInitialComponent());
}
}
}
Aggregations