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);
}
}
use of org.olat.repository.controllers.ReferencableEntriesSearchController in project OpenOLAT by OpenOLAT.
the class WikiEditController 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 == previewLink) {
// Preview as modal dialogue only if the config is valid
RepositoryEntry re = getWikiRepoReference(moduleConfiguration, 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
this.showError("error.repoentrymissing");
} else {
// File cpRoot =
// FileResourceManager.getInstance().unzipFileResource(re.getOlatResource());
Identity ident = ureq.getIdentity();
boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
boolean isResourceOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ident, re);
CourseEnvironment cenv = course.getCourseEnvironment();
SubscriptionContext subsContext = WikiManager.createTechnicalSubscriptionContextForCourse(cenv, wikiCourseNode);
WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOlatAdmin, false, false, isResourceOwner, subsContext);
wikiCtr = WikiManager.getInstance().createWikiMainController(ureq, getWindowControl(), re.getOlatResource(), callback, null);
cmcWikiCtr = new CloseableModalController(getWindowControl(), translate("command.close"), wikiCtr.getInitialComponent());
this.listenTo(cmcWikiCtr);
cmcWikiCtr.activate();
}
} else if (source == chooseButton || source == changeButton) {
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, WikiResource.TYPE_NAME, translate("command.choose"));
this.listenTo(searchController);
cmcSearchController = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate("command.create"));
cmcSearchController.activate();
} else if (source == editLink) {
RepositoryEntry repositoryEntry = wikiCourseNode.getReferencedRepositoryEntry();
if (repositoryEntry == null) {
// do nothing
return;
}
String bPath = "[RepositoryEntry:" + repositoryEntry.getKey() + "][Editor:0]";
NewControllerFactory.getInstance().launch(bPath, ureq, getWindowControl());
}
}
use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.
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);
}
}
use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.
the class PortfolioConfigForm method doChangeTemplate.
private void doChangeTemplate(UserRequest ureq) {
if (searchController != null)
return;
if (isDirty) {
showWarning("form.dirty");
return;
}
removeAsListenerAndDispose(searchController);
removeAsListenerAndDispose(cmc);
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { EPTemplateMapResource.TYPE_NAME, BinderTemplateResource.TYPE_NAME }, translate("select.map2"), false, true, false, false);
listenTo(searchController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate("select.map"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.repository.controllers.ReferencableEntriesSearchController in project openolat by klemens.
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);
}
Aggregations