Search in sources :

Example 16 with ReferencableEntriesSearchController

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

the class CourseOverviewController method doSearchRepoEntries.

private void doSearchRepoEntries(UserRequest ureq, SearchType type, String title) {
    removeAsListenerAndDispose(repoSearchCtr);
    removeAsListenerAndDispose(cmc);
    RepositoryEntryFilter filter = new ManagedEntryfilter();
    repoSearchCtr = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { CourseModule.getCourseTypeName() }, filter, translate("choose"), false, false, true, true, Can.all);
    repoSearchCtr.setUserObject(type);
    listenTo(repoSearchCtr);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), repoSearchCtr.getInitialComponent(), true, title);
    listenTo(cmc);
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) RepositoryEntryFilter(org.olat.repository.controllers.RepositoryEntryFilter) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 17 with ReferencableEntriesSearchController

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

the class EPMapRunController method popUpCreateMapFromTemplateBox.

private void popUpCreateMapFromTemplateBox(UserRequest ureq) {
    String title = translate("create.map");
    String commandLabel = translate("create.map.selectTemplate");
    removeAsListenerAndDispose(searchTemplateCtrl);
    searchTemplateCtrl = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { EPTemplateMapResource.TYPE_NAME }, commandLabel, false, false, false, false);
    listenTo(searchTemplateCtrl);
    createMapBox = new CloseableModalController(getWindowControl(), title, searchTemplateCtrl.getInitialComponent(), true, title);
    createMapBox.setCustomWindowCSS("o_sel_add_map_template_window");
    listenTo(createMapBox);
    createMapBox.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 18 with ReferencableEntriesSearchController

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

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 19 with ReferencableEntriesSearchController

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

the class AssignmentEditController method doSelectForm.

private void doSelectForm(UserRequest ureq) {
    if (searchFormCtrl != null)
        return;
    searchFormCtrl = new ReferencableEntriesSearchController(getWindowControl(), ureq, EvaluationFormResource.TYPE_NAME, translate("select.form"));
    listenTo(searchFormCtrl);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), searchFormCtrl.getInitialComponent(), true, translate("select.form"));
    cmc.suppressDirtyFormWarningOnClose();
    listenTo(cmc);
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ReferencableEntriesSearchController(org.olat.repository.controllers.ReferencableEntriesSearchController)

Example 20 with ReferencableEntriesSearchController

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

the class CourseOptionsController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == addGlossaryCommand) {
        glossarySearchCtr = new ReferencableEntriesSearchController(getWindowControl(), ureq, GlossaryResource.TYPE_NAME, translate("select"));
        listenTo(glossarySearchCtr);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), glossarySearchCtr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
    } else if (source == removeGlossaryCommand) {
        doRemoveGlossary();
        setSaveButtonDirty();
    } else if (source == addFolderCommand) {
        if (checkForFolderNodesAdd(ureq)) {
            folderSearchCtr = new ReferencableEntriesSearchController(getWindowControl(), ureq, SharedFolderFileResource.TYPE_NAME, translate("select"));
            listenTo(folderSearchCtr);
            cmc = new CloseableModalController(getWindowControl(), translate("close"), folderSearchCtr.getInitialComponent());
            listenTo(cmc);
            cmc.activate();
        }
    } else if (source == removeFolderCommand) {
        if (checkForFolderNodesRemove(ureq)) {
            doRemoveSharedFolder();
            setSaveButtonDirty();
        }
    } else if (toolbarEl == source) {
        if (!toolbarEl.isSelected(0)) {
            showWarning("chkbx.toolbar.off.warning");
        }
        updateToolbar();
        setSaveButtonDirty();
    } else if (source instanceof SelectionElement || source == folderReadOnlyEl || source == menuEl) {
        setSaveButtonDirty();
    } else if (saveButton == source) {
        doSave(ureq);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) SelectionElement(org.olat.core.gui.components.form.flexible.elements.SelectionElement) 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