Search in sources :

Example 1 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.

the class IQConfigurationController method doChangeSelfTest.

private void doChangeSelfTest(UserRequest ureq) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(searchController);
    String[] types = new String[] { TestFileResource.TYPE_NAME, ImsQTI21Resource.TYPE_NAME };
    searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, types, translate("command.chooseTest"));
    listenTo(searchController);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent());
    listenTo(searchController);
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 2 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.

the class IQConfigurationController method doChooseTestAndSurvey.

private void doChooseTestAndSurvey(UserRequest ureq) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(searchController);
    if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
        searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, SurveyFileResource.TYPE_NAME, translate("command.chooseSurvey"));
    } else {
        // test and selftest use same repository resource type
        searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { TestFileResource.TYPE_NAME, ImsQTI21Resource.TYPE_NAME }, translate("command.chooseTest"));
    }
    listenTo(searchController);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate("command.chooseRepFile"));
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 3 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.

the class QuestionListController method doOpenRepositoryImport.

private void doOpenRepositoryImport(UserRequest ureq) {
    removeAsListenerAndDispose(importTestCtrl);
    String[] allowed;
    if (qtiModule.isCreateResourcesEnabled()) {
        allowed = new String[] { ImsQTI21Resource.TYPE_NAME, TestFileResource.TYPE_NAME, SurveyFileResource.TYPE_NAME };
    } else {
        allowed = new String[] { ImsQTI21Resource.TYPE_NAME };
    }
    importTestCtrl = new ReferencableEntriesSearchController(getWindowControl(), ureq, allowed, null, translate("import.repository"), false, false, false, true, Can.copyable);
    listenTo(importTestCtrl);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), importTestCtrl.getInitialComponent(), true, translate("import.repository"));
    cmc.setContextHelp(getTranslator(), "Data Management#qb_share");
    cmc.activate();
    listenTo(cmc);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 4 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.

the class CompMenuForm 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)
 */
public void event(UserRequest ureq, Component source, Event event) {
    if (source == chooseCPButton || source == changeCPButton) {
        removeAsListenerAndDispose(searchController);
        searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, ImsCPFileResource.TYPE_NAME, translate(NLS_COMMAND_CHOOSECP));
        listenTo(searchController);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate(NLS_COMMAND_CREATECP));
        listenTo(cmc);
        cmc.activate();
    } else if (source == previewLink) {
        // Preview as modal dialogue only if the config is valid
        RepositoryEntry re = getCPReference(config, false);
        if (re == null) {
            // we cannot preview it, because the repository entry
            // had been deleted between the time when it was chosen here, and now
            showError(NLS_ERROR_CPREPOENTRYMISSING);
        } else {
            File cpRoot = FileResourceManager.getInstance().unzipFileResource(re.getOlatResource());
            Boolean showMenuB = config.getBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU);
            // pre: showMenuB != null
            removeAsListenerAndDispose(previewCtr);
            DeliveryOptions previewOptions = deliveryOptionsCtrl.getOptionsForPreview();
            previewCtr = CPUIFactory.getInstance().createMainLayoutPreviewController_v2(ureq, getWindowControl(), new LocalFolderImpl(cpRoot), showMenuB.booleanValue(), previewOptions);
            stackPanel.pushController(translate("preview.cp"), previewCtr);
        }
    } else if (source == editLink) {
        CourseNodeFactory.getInstance().launchReferencedRepoEntryEditor(ureq, getWindowControl(), cpNode);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) RepositoryEntry(org.olat.repository.RepositoryEntry) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController) File(java.io.File) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) LocalFolderImpl(org.olat.core.util.vfs.LocalFolderImpl)

Example 5 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.

the class BGConfigResourcesStepController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == addResource) {
        removeAsListenerAndDispose(repoSearchCtr);
        removeAsListenerAndDispose(cmc);
        repoSearchCtr = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { CourseModule.getCourseTypeName() }, translate("resources.add"), true, true, true, true);
        listenTo(repoSearchCtr);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), this.repoSearchCtr.getInitialComponent(), true, translate("resources.add.title"));
        listenTo(cmc);
        cmc.activate();
    } else {
        super.formInnerEvent(ureq, source, event);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Aggregations

ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)40 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)38 RepositoryEntry (org.olat.repository.RepositoryEntry)10 File (java.io.File)6 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)4 Identity (org.olat.core.id.Identity)4 RepositoryEntryFilter (org.olat.repository.controllers.RepositoryEntryFilter)4 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)2 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)2 SelectionElement (org.olat.core.gui.components.form.flexible.elements.SelectionElement)2 LocalFolderImpl (org.olat.core.util.vfs.LocalFolderImpl)2 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)2 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)2 QTIResult (org.olat.ims.qti.QTIResult)2 ScormAPIandDisplayController (org.olat.modules.scorm.ScormAPIandDisplayController)2 VideoDisplayController (org.olat.modules.video.ui.VideoDisplayController)2 FeedPreviewSecurityCallback (org.olat.modules.webFeed.FeedPreviewSecurityCallback)2 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)2 WikiSecurityCallback (org.olat.modules.wiki.WikiSecurityCallback)2 WikiSecurityCallbackImpl (org.olat.modules.wiki.WikiSecurityCallbackImpl)2