use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class OverviewBusinessGroupListController method updateMyGroups.
private BusinessGroupListController updateMyGroups(UserRequest ureq) {
cleanUp();
OLATResourceable ores = OresHelper.createOLATResourceableInstance("AllGroups", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
myGroupsCtrl = new BusinessGroupListController(ureq, bwControl, "my");
listenTo(myGroupsCtrl);
currentCtrl = myGroupsCtrl;
myGroupsCtrl.doDefaultSearch();
mainVC.put("groupList", myGroupsCtrl.getInitialComponent());
addToHistory(ureq, myGroupsCtrl);
return myGroupsCtrl;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class OverviewBusinessGroupListController method updateSearch.
private SearchBusinessGroupListController updateSearch(UserRequest ureq) {
cleanUp();
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Search", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
searchGroupsCtrl = new SearchBusinessGroupListController(ureq, bwControl, "search");
listenTo(searchGroupsCtrl);
currentCtrl = searchGroupsCtrl;
mainVC.put("groupList", searchGroupsCtrl.getInitialComponent());
addToHistory(ureq, searchGroupsCtrl);
return searchGroupsCtrl;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class OverviewBusinessGroupListController method updateOpenGroups.
private OpenBusinessGroupListController updateOpenGroups(UserRequest ureq) {
cleanUp();
OLATResourceable ores = OresHelper.createOLATResourceableInstance("OwnedGroups", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
openGroupsCtrl = new OpenBusinessGroupListController(ureq, bwControl, "public");
listenTo(openGroupsCtrl);
currentCtrl = openGroupsCtrl;
openGroupsCtrl.doDefaultSearch();
mainVC.put("groupList", openGroupsCtrl.getInitialComponent());
addToHistory(ureq, openGroupsCtrl);
return openGroupsCtrl;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class OlatFooterController method doOpenImpressum.
protected void doOpenImpressum(UserRequest ureq) {
ControllerCreator impressumControllerCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
return new ImpressumMainController(lureq, lwControl);
}
};
PopupBrowserWindow popupBrowserWindow;
if (ureq.getUserSession().isAuthenticated()) {
popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, impressumControllerCreator);
} else {
popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewUnauthenticatedPopupWindowFor(ureq, impressumControllerCreator);
}
popupBrowserWindow.open(ureq);
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class LDAPAdminController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component,
* org.olat.core.gui.control.Event)
*/
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == syncStartLink) {
// Start sync job
// Disable start link during sync
syncStartLink.setEnabled(false);
LDAPEvent ldapEvent = new LDAPEvent(LDAPEvent.DO_SYNCHING);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(ldapEvent, LDAPLoginManager.ldapSyncLockOres);
showInfo("admin.synchronize.started");
} else if (source == syncOneUserLink) {
userSearchCtrl = new UserSearchController(ureq, getWindowControl(), false);
listenTo(userSearchCtrl);
calloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), userSearchCtrl.getInitialComponent(), syncOneUserLink, null, true, null);
calloutCtr.addDisposableChildController(userSearchCtrl);
calloutCtr.activate();
listenTo(calloutCtr);
} else if (source == deletStartLink) {
// cancel if some one else is making sync or delete job
if (!ldapLoginManager.acquireSyncLock()) {
showError("delete.error.lock");
} else {
deletStartLink.setEnabled(false);
// check and get LDAP connection
LdapContext ctx = ldapLoginManager.bindSystem();
if (ctx == null) {
showError("delete.error.connection");
return;
}
// get deleted users
identitiesToDelete = ldapLoginManager.getIdentitysDeletedInLdap(ctx);
try {
ctx.close();
} catch (NamingException e) {
showError("delete.error.connection.close");
logError("Could not close LDAP connection on manual delete sync", e);
}
if (identitiesToDelete != null && identitiesToDelete.size() != 0) {
hasIdentitiesToDelete = true;
/*
* start step which spawns the whole wizard
*/
Step start = new DeletStep00(ureq, hasIdentitiesToDelete, identitiesToDelete);
/*
* wizard finish callback called after "finish" is called
*/
StepRunnerCallback finishCallback = new StepRunnerCallback() {
public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
hasIdentitiesToDeleteAfterRun = ((Boolean) runContext.get("hasIdentitiesToDelete")).booleanValue();
if (hasIdentitiesToDeleteAfterRun) {
@SuppressWarnings("unchecked") List<Identity> idToDelete = (List<Identity>) runContext.get("identitiesToDelete");
amountUsersToDelete = idToDelete.size();
// Delete all identities now and tell everybody that
// we are finished
ldapLoginManager.deletIdentities(idToDelete);
return StepsMainRunController.DONE_MODIFIED;
} else {
return StepsMainRunController.DONE_UNCHANGED;
}
// otherwise return without deleting anything
}
};
deleteStepController = new StepsMainRunController(ureq, getWindowControl(), start, finishCallback, null, translate("admin.deleteUser.title"), "o_sel_ldap_delete_user_wizard");
listenTo(deleteStepController);
getWindowControl().pushAsModalDialog(deleteStepController.getInitialComponent());
} else {
hasIdentitiesToDelete = false;
showInfo("delete.step.noUsers");
deletStartLink.setEnabled(true);
ldapLoginManager.freeSyncLock();
}
}
} else if (source == removeFallBackAuthsLink) {
removeFallBackAuthsLink.setEnabled(false);
ldapLoginManager.removeFallBackAuthentications();
showInfo("opsuccess");
}
}
Aggregations