Search in sources :

Example 11 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.

the class FeedNodeEditController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == chooseButton || source == changeButton) {
        searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, resourceTypeName, translate(BUTTON_CHOOSE_FEED));
        listenTo(searchController);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate(BUTTON_CREATE_FEED));
        cmc.activate();
    } else if (source == previewLink) {
        // Preview as modal dialogue only if the config is valid
        RepositoryEntry re = node.getReferencedRepositoryEntry();
        if (re == null) {
            // The repository entry has been deleted meanwhile.
            showError("error.repoentrymissing");
        } else {
            FeedSecurityCallback callback = new FeedPreviewSecurityCallback();
            feedController = uiFactory.createMainController(re.getOlatResource(), ureq, getWindowControl(), callback, course.getResourceableId(), node.getIdent());
            cmcFeedCtr = new CloseableModalController(getWindowControl(), translate("command.close"), feedController.getInitialComponent());
            listenTo(cmcFeedCtr);
            cmcFeedCtr.activate();
        }
    } else if (source == editLink) {
        boolean launched = CourseNodeFactory.getInstance().launchReferencedRepoEntryEditor(ureq, getWindowControl(), node);
        if (!launched) {
            RepositoryEntry re = node.getReferencedRepositoryEntry();
            if (re == null) {
                showError("error.repoentrymissing");
            } else {
                showError("error.wrongtype");
            }
        }
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) FeedPreviewSecurityCallback(org.olat.modules.webFeed.FeedPreviewSecurityCallback) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 12 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.

the class IQEditReplaceWizard method doStep1.

private void doStep1(UserRequest ureq) {
    searchCtr = new ReferencableEntriesSearchController(getWindowControl(), ureq, types, translate("command.chooseTest"));
    searchCtr.addControllerListener(this);
    vcStep1 = createVelocityContainer("replacewizard_step1");
    vcStep1.put("search", searchCtr.getInitialComponent());
    setNextWizardStep(translate("replace.wizard.title.step1"), vcStep1);
}
Also used : ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 13 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.

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)

Example 14 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.

the class SelectCourseStepForm method doChooseCourse.

private void doChooseCourse(UserRequest ureq) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(searchCtrl);
    searchCtrl = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { CourseModule.ORES_TYPE_COURSE }, translate("step.select.course"));
    listenTo(searchCtrl);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), searchCtrl.getInitialComponent(), true, translate("step.select.course"));
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 15 with ReferencableEntriesSearchController

use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.

the class VideoOptionsForm method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == chooseVideoButton || source == changeVideoButton) {
        removeAsListenerAndDispose(searchController);
        searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { VideoFileResource.TYPE_NAME }, translate(NLS_COMMAND_CHOOSEVIDEO), true, false, false, false);
        listenTo(searchController);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
        listenTo(cmc);
        cmc.activate();
    } else if (source == previewLink) {
        VideoDisplayController previewController = null;
        switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT)) {
            case "resourceDescription":
                previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", false, false, "", true);
                break;
            case "customDescription":
                previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT), true);
                break;
            case "none":
                previewController = new VideoDisplayController(ureq, getWindowControl(), repositoryEntry, config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY), config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS), config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING), true, "", true, false, "", true);
                break;
        }
        cmc = new CloseableModalController(getWindowControl(), translate("close"), previewController.getInitialComponent(), true, translate(NLS_COMMAND_CHOOSEVIDEO));
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) VideoDisplayController(org.olat.modules.video.ui.VideoDisplayController) 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