use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class VCCourseNode method createNodeRunConstructionResult.
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
// check if user is moderator of the virtual classroom
Roles roles = ureq.getUserSession().getRoles();
boolean moderator = roles.isOLATAdmin();
Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
if (!moderator) {
if (roles.isInstitutionalResourceManager() | roles.isAuthor()) {
RepositoryManager rm = RepositoryManager.getInstance();
ICourse course = CourseFactory.loadCourse(key);
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
if (re != null) {
moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
if (!moderator) {
moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
}
}
}
}
// load configuration
final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
VCConfiguration config = handleConfig(provider);
// create run controller
Controller runCtr = new VCRunController(ureq, wControl, key + "_" + getIdent(), getShortName(), getLongTitle(), config, provider, moderator, userCourseEnv.isCourseReadOnly());
Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_vc_icon");
return new NodeRunConstructionResult(controller);
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class UserAdminController method initTabbedPane.
/**
* Initialize the tabbed pane according to the users rights and the system
* configuration
* @param identity
* @param ureq
*/
private void initTabbedPane(Identity identity, UserRequest ureq) {
// first Initialize the user details tabbed pane
userTabP = new TabbedPane("userTabP", ureq.getLocale());
userTabP.addListener(this);
/**
* Determine, whether the user admin is or is not able to edit all fields in user
* profile form. The system admin is always able to do so.
*/
Boolean canEditAllFields = BaseSecurityModule.USERMANAGER_CAN_EDIT_ALL_PROFILE_FIELDS;
if (securityManager.isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_ADMIN)) {
canEditAllFields = Boolean.TRUE;
}
userProfileCtr = new ProfileAndHomePageEditController(ureq, getWindowControl(), identity, canEditAllFields.booleanValue());
listenTo(userProfileCtr);
userTabP.addTab(translate(NLS_EDIT_UPROFILE), userProfileCtr.getInitialComponent());
userTabP.addTab(translate(NLS_EDIT_UPREFS), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
prefsCtr = new ChangePrefsController(uureq, getWindowControl(), identity);
listenTo(prefsCtr);
return prefsCtr.getInitialComponent();
}
});
if (isPasswordChangesAllowed(identity)) {
userTabP.addTab(translate(NLS_EDIT_UPWD), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
pwdCtr = new UserChangePasswordController(uureq, getWindowControl(), identity);
listenTo(pwdCtr);
return pwdCtr.getInitialComponent();
}
});
}
Boolean canAuth = BaseSecurityModule.USERMANAGER_ACCESS_TO_AUTH;
if (canAuth.booleanValue() || isOlatAdmin) {
userTabP.addTab(translate(NLS_EDIT_UAUTH), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
authenticationsCtr = new UserAuthenticationsEditorController(uureq, getWindowControl(), identity);
listenTo(authenticationsCtr);
return authenticationsCtr.getInitialComponent();
}
});
}
Boolean canProp = BaseSecurityModule.USERMANAGER_ACCESS_TO_PROP;
if (canProp.booleanValue() || isOlatAdmin) {
userTabP.addTab(translate(NLS_EDIT_UPROP), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
propertiesCtr = new UserPropertiesController(uureq, getWindowControl(), identity);
listenTo(propertiesCtr);
return propertiesCtr.getInitialComponent();
}
});
}
Boolean canStartGroups = BaseSecurityModule.USERMANAGER_CAN_START_GROUPS;
userTabP.addTab(translate(NLS_VIEW_GROUPS), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
grpCtr = new GroupOverviewController(uureq, getWindowControl(), identity, canStartGroups);
listenTo(grpCtr);
return grpCtr.getInitialComponent();
}
});
userTabP.addTab(translate(NLS_VIEW_COURSES), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
courseCtr = new CourseOverviewController(uureq, getWindowControl(), identity);
listenTo(courseCtr);
return courseCtr.getInitialComponent();
}
});
if (isOlatAdmin) {
userTabP.addTab(translate(NLS_VIEW_ACCESS), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
Controller accessCtr = new UserOrderController(uureq, getWindowControl(), identity);
listenTo(accessCtr);
return accessCtr.getInitialComponent();
}
});
}
if (isOlatAdmin) {
userTabP.addTab(translate(NLS_VIEW_EFF_STATEMENTS), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
efficicencyCtrl = new CertificateAndEfficiencyStatementListController(uureq, getWindowControl(), identity, true);
listenTo(efficicencyCtrl);
BreadcrumbedStackedPanel stackPanel = new BreadcrumbedStackedPanel("statements", getTranslator(), efficicencyCtrl);
stackPanel.pushController(translate(NLS_VIEW_EFF_STATEMENTS), efficicencyCtrl);
efficicencyCtrl.setBreadcrumbPanel(stackPanel);
stackPanel.setInvisibleCrumb(1);
return stackPanel;
}
});
}
Boolean canSubscriptions = BaseSecurityModule.USERMANAGER_CAN_MODIFY_SUBSCRIPTIONS;
if (canSubscriptions.booleanValue() || isOlatAdmin) {
userTabP.addTab(translate(NLS_VIEW_SUBSCRIPTIONS), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
Controller subscriptionsCtr = new NotificationSubscriptionController(uureq, getWindowControl(), identity, true);
listenTo(subscriptionsCtr);
return subscriptionsCtr.getInitialComponent();
}
});
}
userTabP.addTab(translate(NLS_EDIT_UROLES), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
rolesCtr = new SystemRolesAndRightsController(getWindowControl(), uureq, identity);
listenTo(rolesCtr);
return rolesCtr.getInitialComponent();
}
});
Boolean canQuota = BaseSecurityModule.USERMANAGER_ACCESS_TO_QUOTA;
if (canQuota.booleanValue() || isOlatAdmin) {
userTabP.addTab(translate(NLS_EDIT_UQUOTA), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
String relPath = FolderConfig.getUserHomes() + "/" + identity.getName();
quotaCtr = QuotaManager.getInstance().getQuotaEditorInstance(uureq, getWindowControl(), relPath);
return quotaCtr.getInitialComponent();
}
});
}
if (lectureModule.isEnabled()) {
userTabP.addTab(translate(NLS_VIEW_LECTURES), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
lecturesCtrl = new ParticipantLecturesOverviewController(uureq, getWindowControl(), identity, true, true, true, true);
listenTo(lecturesCtrl);
BreadcrumbedStackedPanel stackPanel = new BreadcrumbedStackedPanel("lectures", getTranslator(), lecturesCtrl);
stackPanel.pushController(translate(NLS_VIEW_LECTURES), lecturesCtrl);
lecturesCtrl.setBreadcrumbPanel(stackPanel);
stackPanel.setInvisibleCrumb(1);
return stackPanel;
}
});
}
if (taxonomyModule.isEnabled()) {
userTabP.addTab(translate(NLS_VIEW_COMPETENCES), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
competencesCtrl = new IdentityCompetencesController(uureq, getWindowControl(), identity);
listenTo(competencesCtrl);
BreadcrumbedStackedPanel stackPanel = new BreadcrumbedStackedPanel("competences", getTranslator(), competencesCtrl);
stackPanel.pushController(translate(NLS_VIEW_COMPETENCES), competencesCtrl);
competencesCtrl.setBreadcrumbPanel(stackPanel);
stackPanel.setInvisibleCrumb(1);
return stackPanel;
}
});
}
// now push to velocity
myContent.put("userTabP", userTabP);
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class UserAdminMainController method createAndLockDirectUserDeleteController.
/**
* Creates a DirectDeleteController and acquire a 'delete-user-lock'.
* The lock is for both direct-deletion and workflow with email.
* @param ureq
* @return
*/
private Component createAndLockDirectUserDeleteController(UserRequest ureq, WindowControl wControl) {
Controller lockCtrl = acquireDeleteUserLock(ureq);
if (lockCtrl == null) {
// success -> create new User deletion workflow
removeAsListenerAndDispose(contentCtr);
contentCtr = new DirectDeleteController(ureq, wControl);
listenTo(contentCtr);
return contentCtr.getInitialComponent();
} else {
// failure -> monolog controller with message that lock failed
return lockCtrl.getInitialComponent();
}
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class UserAdminMainController method acquireDeleteUserLock.
/**
* Acquire lock for whole delete-user workflow
*/
private Controller acquireDeleteUserLock(UserRequest ureq) {
OLATResourceable lockResourceable = OresHelper.createOLATResourceableTypeWithoutCheck(TabbedPaneController.class.getName());
lock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockResourceable, ureq.getIdentity(), "deleteGroup");
if (!lock.isSuccess()) {
String fullname = userManager.getUserDisplayName(lock.getOwner());
String text = getTranslator().translate("error.deleteworkflow.locked.by", new String[] { fullname });
Controller monoCtr = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
return monoCtr;
}
return null;
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class CollaborationTools method createPortfolioController.
/**
* @param ureq
* @param wControl
* @param mapProperty The property is mandatory!
* @return
*/
private Controller createPortfolioController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, Property mapProperty) {
Long key = mapProperty.getLongValue();
String version = mapProperty.getStringValue();
Controller ctrl;
if ("2".equals(version)) {
PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
Binder binder = portfolioService.getBinderByKey(key);
portfolioService.updateBinderUserInformations(binder, ureq.getIdentity());
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForBusinessGroup();
BinderController binderCtrl = new BinderController(ureq, wControl, stackPanel, secCallback, binder, BinderConfiguration.createBusinessGroupConfig());
ctrl = binderCtrl;
} else {
PortfolioStructureMap map = (PortfolioStructureMap) CoreSpringFactory.getImpl(EPFrontendManager.class).loadPortfolioStructureByKey(key);
EPSecurityCallback secCallback = new EPSecurityCallbackImpl(true, true);
ctrl = EPUIFactory.createMapViewController(ureq, wControl, map, secCallback);
}
return ctrl;
}
Aggregations