Search in sources :

Example 1 with FolderRunController

use of org.olat.core.commons.modules.bc.FolderRunController in project OpenOLAT by OpenOLAT.

the class TaskFolderCallback 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 urequest, Controller source, Event event) {
    if (source == modulesForm) {
        boolean onoff = event.getCommand().endsWith("true");
        if (event.getCommand().startsWith("task")) {
            config.set(TACourseNode.CONF_TASK_ENABLED, new Boolean(onoff));
            myTabbedPane.setEnabled(taskTabPosition, onoff);
            if (onoff) {
                accessabilityVC.put("taskCondition", taskConditionC.getInitialComponent());
            } else {
                accessabilityVC.remove(taskConditionC.getInitialComponent());
            }
        } else if (event.getCommand().startsWith("dropbox")) {
            config.set(TACourseNode.CONF_DROPBOX_ENABLED, new Boolean(onoff));
            myTabbedPane.setEnabled(dropboxTabPosition, onoff);
            if (onoff) {
                accessabilityVC.put("dropCondition", dropConditionC.getInitialComponent());
            } else {
                accessabilityVC.remove(dropConditionC.getInitialComponent());
            }
        } else if (event.getCommand().startsWith("returnbox")) {
            config.set(TACourseNode.CONF_RETURNBOX_ENABLED, new Boolean(onoff));
            if (onoff) {
                accessabilityVC.put("returnboxCondition", returnboxConditionC.getInitialComponent());
            } else {
                accessabilityVC.remove(returnboxConditionC.getInitialComponent());
            }
        } else if (event.getCommand().startsWith("scoring")) {
            config.set(TACourseNode.CONF_SCORING_ENABLED, new Boolean(onoff));
            myTabbedPane.setEnabled(scoringTabPosition, onoff);
            if (onoff) {
                accessabilityVC.put("scoringCondition", scoringConditionC.getInitialComponent());
            } else {
                accessabilityVC.remove(scoringConditionC.getInitialComponent());
            }
        } else if (event.getCommand().startsWith("solution")) {
            config.set(TACourseNode.CONF_SOLUTION_ENABLED, new Boolean(onoff));
            myTabbedPane.setEnabled(solutionTabPosition, onoff);
            if (onoff) {
                accessabilityVC.put("solutionCondition", solutionConditionC.getInitialComponent());
            } else {
                accessabilityVC.remove(solutionConditionC.getInitialComponent());
            }
        }
        fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        return;
    } else if (source == taskConditionC) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionTask(taskConditionC.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == dropConditionC) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionDrop(dropConditionC.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == returnboxConditionC) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionReturnbox(returnboxConditionC.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == scoringConditionC) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionScoring(scoringConditionC.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == solutionConditionC) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionSolution(solutionConditionC.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == dialogBoxController) {
        if (DialogBoxUIFactory.isOkEvent(event)) {
            // ok: open task folder
            String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
            OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
            OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
            namedFolder.setLocalSecurityCallback(getTaskFolderSecCallback(relPath));
            frc = new FolderRunController(namedFolder, false, urequest, getWindowControl());
            listenTo(frc);
            CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc.getInitialComponent());
            cmc.activate();
            fireEvent(urequest, Event.CHANGED_EVENT);
        }
    } else if (source == taskController) {
        if (event == Event.CANCELLED_EVENT) {
            return;
        } else if (event == Event.DONE_EVENT) {
            config.set(TACourseNode.CONF_TASK_TYPE, taskController.getTaskType());
            config.set(TACourseNode.CONF_TASK_TEXT, taskController.getOptionalText());
            config.set(TACourseNode.CONF_TASK_SAMPLING_WITH_REPLACEMENT, new Boolean(taskController.getIsSamplingWithReplacement()));
            config.setBooleanEntry(TACourseNode.CONF_TASK_PREVIEW, taskController.isTaskPreviewMode());
            config.setBooleanEntry(TACourseNode.CONF_TASK_DESELECT, taskController.isTaskDeselectMode());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
            return;
        }
    } else if (source == scoringController) {
        if (event == Event.CANCELLED_EVENT) {
            if (hasLogEntries) {
                scoringController.setDisplayOnly(true);
            }
            editScoring.contextPut("isOverwriting", new Boolean(false));
            return;
        } else if (event == Event.DONE_EVENT) {
            scoringController.updateModuleConfiguration(config);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == dropboxForm) {
        if (event == Event.CANCELLED_EVENT) {
            return;
        } else if (event == Event.DONE_EVENT) {
            config.set(TACourseNode.CONF_DROPBOX_ENABLEMAIL, new Boolean(dropboxForm.mailEnabled()));
            config.set(TACourseNode.CONF_DROPBOX_CONFIRMATION, dropboxForm.getConfirmation());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
            return;
        }
    } else if (source == frc && (event instanceof FolderEvent) && event.getCommand().equals(FolderEvent.DELETE_EVENT)) {
        String deletedTaskFile = getFileListAsComaSeparated(((FolderEvent) event).getFilename());
        // cancel task assignment
        identitiesToBeNotified = removeAssignedTask(course, deletedTaskFile);
        if (identitiesToBeNotified.size() > 0) {
            // prepare mailTemplate if they are any identities to be notified
            removeAsListenerAndDispose(mailCtr);
            RepositoryEntry repositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
            String courseURL = Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + repositoryEntry.getKey();
            MailTemplate mailTemplate = this.createTaskDeletedMailTemplate(urequest, course.getCourseTitle(), courseURL, deletedTaskFile);
            mailCtr = new MailNotificationEditController(getWindowControl(), urequest, mailTemplate, true, false, true);
            listenTo(mailCtr);
            cmc = new CloseableModalController(getWindowControl(), translate("close"), mailCtr.getInitialComponent());
            listenTo(cmc);
            cmc.activate();
        }
    } else if (source == mailCtr) {
        if (event == Event.DONE_EVENT) {
            cmc.deactivate();
            if (identitiesToBeNotified != null && identitiesToBeNotified.size() > 0) {
                // sent email to all identities that used to have the deleted task assigned
                sendNotificationEmail(urequest, mailCtr.getMailTemplate(), identitiesToBeNotified);
            }
        } else if (event == Event.CANCELLED_EVENT) {
            cmc.deactivate();
        }
    } else {
        log.warn("Can not handle event in TACourseNodeEditController source=" + source + " " + event.toString());
    }
}
Also used : OlatNamedContainerImpl(org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) MailTemplate(org.olat.core.util.mail.MailTemplate) FolderEvent(org.olat.core.commons.modules.bc.FolderEvent) RepositoryEntry(org.olat.repository.RepositoryEntry) MailNotificationEditController(org.olat.core.util.mail.MailNotificationEditController)

Example 2 with FolderRunController

use of org.olat.core.commons.modules.bc.FolderRunController in project OpenOLAT by OpenOLAT.

the class FolderCallback 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 urequest, Controller source, Event event) {
    if (source == projectBrokerConditionController) {
        if (event == Event.CHANGED_EVENT) {
            node.setConditionProjectBroker(projectBrokerConditionController.getCondition());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == dialogBoxController) {
        if (DialogBoxUIFactory.isOkEvent(event)) {
            // ok: open task folder
            String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(CourseFactory.loadCourse(courseId), node);
            OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
            OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
            namedFolder.setLocalSecurityCallback(new FolderCallback(relPath, false));
            removeAsListenerAndDispose(frc);
            frc = new FolderRunController(namedFolder, false, urequest, getWindowControl());
            listenTo(frc);
            removeAsListenerAndDispose(cmc);
            cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc.getInitialComponent());
            listenTo(cmc);
            cmc.activate();
            fireEvent(urequest, Event.CHANGED_EVENT);
        }
    } else if (source == scoringController) {
        if (event == Event.CANCELLED_EVENT) {
            if (hasLogEntries) {
                scoringController.setDisplayOnly(true);
            }
            editScoring.contextPut("isOverwriting", new Boolean(false));
            return;
        } else if (event == Event.DONE_EVENT) {
            scoringController.updateModuleConfiguration(config);
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == modulesForm) {
        boolean onoff = event.getCommand().endsWith("true");
        if (event.getCommand().startsWith("dropbox")) {
            config.set(ProjectBrokerCourseNode.CONF_DROPBOX_ENABLED, onoff);
        } else if (event.getCommand().startsWith("returnbox")) {
            config.set(ProjectBrokerCourseNode.CONF_RETURNBOX_ENABLED, onoff);
        }
        fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        return;
    } else if (source == accountManagerGroupController) {
        if (event instanceof IdentitiesAddEvent) {
            IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent) event;
            BusinessGroupAddResponse response = businessGroupService.addParticipants(urequest.getIdentity(), urequest.getUserSession().getRoles(), identitiesAddedEvent.getAddIdentities(), accountManagerGroup, null);
            identitiesAddedEvent.setIdentitiesAddedEvent(response.getAddedIdentities());
            identitiesAddedEvent.setIdentitiesWithoutPermission(response.getIdentitiesWithoutPermission());
            identitiesAddedEvent.setIdentitiesAlreadyInGroup(response.getIdentitiesAlreadyInGroup());
            getLogger().info("Add users as account-managers");
            fireEvent(urequest, Event.CHANGED_EVENT);
        } else if (event instanceof IdentitiesRemoveEvent) {
            businessGroupService.removeParticipants(urequest.getIdentity(), ((IdentitiesRemoveEvent) event).getRemovedIdentities(), accountManagerGroup, null);
            getLogger().info("Remove users as account-managers");
            fireEvent(urequest, Event.CHANGED_EVENT);
        }
    } else if (source == optionsForm) {
        if (event == Event.CANCELLED_EVENT) {
            return;
        } else if (event == Event.DONE_EVENT) {
            projectBrokerModuleConfiguration.setNbrParticipantsPerTopic(optionsForm.getNnbrOfAttendees());
            if (projectBrokerModuleConfiguration.isAcceptSelectionManually() && !optionsForm.getSelectionAccept()) {
                // change 'Accept manually' to 'Accept automatically' => enroll all candidates
                projectGroupManager.acceptAllCandidates(projectBrokerId, urequest.getIdentity(), projectBrokerModuleConfiguration.isAutoSignOut(), optionsForm.getSelectionAccept());
            }
            projectBrokerModuleConfiguration.setAcceptSelectionManaually(optionsForm.getSelectionAccept());
            projectBrokerModuleConfiguration.setSelectionAutoSignOut(optionsForm.getSelectionAutoSignOut());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == customfieldsForm || source == projectEventForm) {
        if (event == Event.CANCELLED_EVENT) {
            return;
        } else if (event == Event.DONE_EVENT) {
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
        getLogger().debug("NODECONFIG_CHANGED_node.shortTitle=" + node.getShortTitle());
        String groupName = translate("account.manager.groupname", node.getShortTitle());
        String groupDescription = translate("account.manager.groupdescription", node.getShortTitle());
        accountManagerGroup = projectGroupManager.updateAccountManagerGroupName(getIdentity(), groupName, groupDescription, accountManagerGroup);
    } else if (source == dropboxForm) {
        if (event == Event.CANCELLED_EVENT) {
            return;
        } else if (event == Event.DONE_EVENT) {
            config.set(ProjectBrokerCourseNode.CONF_DROPBOX_ENABLEMAIL, dropboxForm.mailEnabled());
            config.set(ProjectBrokerCourseNode.CONF_DROPBOX_CONFIRMATION, dropboxForm.getConfirmation());
            fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
            return;
        }
    } else {
        getLogger().warn("Can not handle event in ProjectBrokerCourseEditorController source=" + source + " " + event.toString());
    }
}
Also used : OlatNamedContainerImpl(org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) IdentitiesRemoveEvent(org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) IdentitiesAddEvent(org.olat.admin.securitygroup.gui.IdentitiesAddEvent) BusinessGroupAddResponse(org.olat.group.BusinessGroupAddResponse)

Example 3 with FolderRunController

use of org.olat.core.commons.modules.bc.FolderRunController in project OpenOLAT by OpenOLAT.

the class CourseRuntimeController method doCourseFolder.

private FolderRunController doCourseFolder(UserRequest ureq) {
    if (delayedClose == Delayed.courseFolder || requestForClose(ureq)) {
        removeCustomCSS();
        // Folder for course with custom link model to jump to course nodes
        ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
        VFSContainer courseContainer;
        if (overrideReadOnly) {
            courseContainer = course.getCourseFolderContainer(overrideReadOnly);
        } else {
            courseContainer = course.getCourseFolderContainer();
        }
        VFSContainer namedCourseFolder = new NamedContainerImpl(translate("command.coursefolder"), courseContainer);
        CustomLinkTreeModel customLinkTreeModel = new CourseInternalLinkTreeModel(course.getEditorTreeModel());
        FolderRunController ctrl = new FolderRunController(namedCourseFolder, true, true, true, true, ureq, getWindowControl(), null, customLinkTreeModel, null);
        ctrl.addLoggingResourceable(LoggingResourceable.wrap(course));
        courseFolderCtrl = pushController(ureq, translate("command.coursefolder"), ctrl);
        setActiveTool(folderLink);
        currentToolCtr = courseFolderCtrl;
    } else {
        delayedClose = Delayed.courseFolder;
    }
    return courseFolderCtrl;
}
Also used : CustomLinkTreeModel(org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel) VFSContainer(org.olat.core.util.vfs.VFSContainer) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) ICourse(org.olat.course.ICourse) NamedContainerImpl(org.olat.core.util.vfs.NamedContainerImpl) CourseInternalLinkTreeModel(org.olat.course.tree.CourseInternalLinkTreeModel)

Example 4 with FolderRunController

use of org.olat.core.commons.modules.bc.FolderRunController in project OpenOLAT by OpenOLAT.

the class CourseRuntimeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        if (currentToolCtr != null) {
            addToHistory(ureq, currentToolCtr);
        } else {
            Controller runtimeCtrl = getRuntimeController();
            if (runtimeCtrl instanceof Activateable2) {
                ((Activateable2) runtimeCtrl).activate(ureq, entries, state);
            } else {
                addToHistory(ureq, runtimeCtrl);
            }
        }
        return;
    }
    entries = removeRepositoryEntry(entries);
    if (entries != null && entries.size() > 0) {
        String type = entries.get(0).getOLATResourceable().getResourceableTypeName();
        if ("Payment".equalsIgnoreCase(type)) {
            doPostSuccessfullAccess(ureq);
        } else if ("Editor".equalsIgnoreCase(type)) {
            if (!isInEditor() && !RepositoryEntryManagedFlag.isManaged(getRepositoryEntry(), RepositoryEntryManagedFlag.editcontent)) {
                doEdit(ureq);
            }
        } else if ("Catalog".equalsIgnoreCase(type)) {
            doCatalog(ureq);
        } else if ("Infos".equalsIgnoreCase(type)) {
            doDetails(ureq);
        } else if ("EditDescription".equalsIgnoreCase(type) || "Settings".equalsIgnoreCase(type)) {
            doEditSettings(ureq);
        } else if ("Settings".equalsIgnoreCase(type)) {
            doOptions(ureq);
        } else if ("CertificationSettings".equalsIgnoreCase(type)) {
            doCertificatesOptions(ureq);
        } else if ("Certification".equalsIgnoreCase(type)) {
            doEfficiencyStatements(ureq);
        } else if ("Reminders".equalsIgnoreCase(type) || "RemindersLogs".equalsIgnoreCase(type)) {
            doReminders(ureq);
        } else if ("Lectures".equalsIgnoreCase(type)) {
            Activateable2 lectures = doLectures(ureq);
            if (lectures != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                lectures.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        } else if ("LectureBlock".equalsIgnoreCase(type)) {
            Activateable2 lectures = doLectures(ureq);
            if (lectures != null) {
                lectures.activate(ureq, entries, state);
            }
        } else if ("LecturesAdmin".equalsIgnoreCase(type)) {
            Activateable2 lecturesAdmin = doLecturesAdmin(ureq);
            if (lecturesAdmin != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                lecturesAdmin.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        } else if ("MembersMgmt".equalsIgnoreCase(type)) {
            Activateable2 members = doMembers(ureq);
            if (members != null) {
                try {
                    List<ContextEntry> subEntries = entries.subList(1, entries.size());
                    members.activate(ureq, subEntries, entries.get(0).getTransientState());
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if ("assessmentTool".equalsIgnoreCase(type) || "assessmentToolv2".equalsIgnoreCase(type)) {
            // check the security before, the link is perhaps in the wrong hands
            if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach() || hasCourseRight(CourseRights.RIGHT_ASSESSMENT)) {
                try {
                    Activateable2 assessmentCtrl = doAssessmentTool(ureq);
                    if (assessmentCtrl != null) {
                        List<ContextEntry> subEntries;
                        if (entries.size() > 1 && entries.get(1).getOLATResourceable().getResourceableTypeName().equals(type)) {
                            subEntries = entries.subList(2, entries.size());
                        } else {
                            subEntries = entries.subList(1, entries.size());
                        }
                        assessmentCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                    }
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if ("TestStatistics".equalsIgnoreCase(type) || "SurveyStatistics".equalsIgnoreCase(type)) {
            // check the security before, the link is perhaps in the wrong hands
            if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach() || hasCourseRight(CourseRights.RIGHT_ASSESSMENT)) {
                try {
                    Activateable2 assessmentCtrl = null;
                    if ("TestStatistics".equalsIgnoreCase(type)) {
                        assessmentCtrl = doAssessmentTestStatistics(ureq);
                    } else {
                        assessmentCtrl = doAssessmentSurveyStatistics(ureq);
                    }
                    List<ContextEntry> subEntries;
                    if (entries.size() > 1 && entries.get(1).getOLATResourceable().getResourceableTypeName().equals(type)) {
                        subEntries = entries.subList(2, entries.size());
                    } else {
                        subEntries = entries.subList(1, entries.size());
                    }
                    assessmentCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if (type != null && type.startsWith("path=")) {
            if (reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_COURSEEDITOR)) {
                String path = BusinessControlFactory.getInstance().getPath(entries.get(0));
                FolderRunController folderCtrl = doCourseFolder(ureq);
                if (folderCtrl != null) {
                    folderCtrl.activatePath(ureq, path);
                }
            }
        }
    }
    if (getRunMainController() != null) {
        getRunMainController().activate(ureq, entries, state);
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) OLATSecurityException(org.olat.core.logging.OLATSecurityException) List(java.util.List) LeavingStatusList(org.olat.repository.LeavingStatusList) StatisticCourseNodesController(org.olat.course.statistic.StatisticCourseNodesController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) StatisticMainController(org.olat.course.statistic.StatisticMainController) CustomDBMainController(org.olat.course.db.CustomDBMainController) SearchInputController(org.olat.search.ui.SearchInputController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) MembersManagementMainController(org.olat.course.member.MembersManagementMainController) VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) GlossaryMainController(org.olat.core.commons.modules.glossary.GlossaryMainController) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) AssessmentToolController(org.olat.course.assessment.ui.tool.AssessmentToolController) TeacherOverviewController(org.olat.modules.lecture.ui.TeacherOverviewController) CourseAreasController(org.olat.course.area.CourseAreasController) CourseOptionsController(org.olat.course.config.ui.CourseOptionsController) EditorMainController(org.olat.course.editor.EditorMainController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) CertificatesOptionsController(org.olat.course.certificate.ui.CertificatesOptionsController) CourseGlossaryToolLinkController(org.olat.course.run.glossary.CourseGlossaryToolLinkController) NoteController(org.olat.note.NoteController) ChiefController(org.olat.core.gui.control.ChiefController) ArchiverMainController(org.olat.course.archiver.ArchiverMainController) AssessmentModeListController(org.olat.course.assessment.ui.mode.AssessmentModeListController) CourseCalendarController(org.olat.course.run.calendar.CourseCalendarController) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) RepositoryEntryLifeCycleChangeController(org.olat.repository.ui.RepositoryEntryLifeCycleChangeController) CourseRemindersController(org.olat.course.reminder.ui.CourseRemindersController) Controller(org.olat.core.gui.control.Controller) CourseLayoutGeneratorController(org.olat.course.config.ui.courselayout.CourseLayoutGeneratorController) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 5 with FolderRunController

use of org.olat.core.commons.modules.bc.FolderRunController in project OpenOLAT by OpenOLAT.

the class UserInfoMainController method doOpenFolder.

private FolderRunController doOpenFolder(UserRequest ureq) {
    removeAsListenerAndDispose(folderRunController);
    String chosenUserFolderRelPath = FolderConfig.getUserHome(chosenIdentity.getName()) + "/public";
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
    OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
    // decided in plenum to have read only view in the personal visiting card, even for admin
    VFSSecurityCallback secCallback = new ReadOnlyCallback();
    namedFolder.setLocalSecurityCallback(secCallback);
    OLATResourceable ores = OresHelper.createOLATResourceableType("userfolder");
    WindowControl bwControl = addToHistory(ureq, ores, null);
    folderRunController = new FolderRunController(namedFolder, false, true, false, ureq, bwControl);
    folderRunController.setResourceURL("[Identity:" + chosenIdentity.getKey() + "][userfolder:0]");
    listenTo(folderRunController);
    return folderRunController;
}
Also used : OlatNamedContainerImpl(org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) ReadOnlyCallback(org.olat.core.util.vfs.callbacks.ReadOnlyCallback) OLATResourceable(org.olat.core.id.OLATResourceable) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) WindowControl(org.olat.core.gui.control.WindowControl) VFSSecurityCallback(org.olat.core.util.vfs.callbacks.VFSSecurityCallback)

Aggregations

FolderRunController (org.olat.core.commons.modules.bc.FolderRunController)22 OlatNamedContainerImpl (org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl)16 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)14 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)12 VFSContainer (org.olat.core.util.vfs.VFSContainer)6 ReadOnlyCallback (org.olat.core.util.vfs.callbacks.ReadOnlyCallback)6 VFSSecurityCallback (org.olat.core.util.vfs.callbacks.VFSSecurityCallback)6 Quota (org.olat.core.util.vfs.Quota)4 FullAccessWithQuotaCallback (org.olat.core.util.vfs.callbacks.FullAccessWithQuotaCallback)4 ICourse (org.olat.course.ICourse)4 File (java.io.File)2 List (java.util.List)2 IdentitiesAddEvent (org.olat.admin.securitygroup.gui.IdentitiesAddEvent)2 IdentitiesRemoveEvent (org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent)2 CustomLinkTreeModel (org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 GlossaryMainController (org.olat.core.commons.modules.glossary.GlossaryMainController)2 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)2 Component (org.olat.core.gui.components.Component)2 ChiefController (org.olat.core.gui.control.ChiefController)2