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");
}
}
}
}
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);
}
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);
}
}
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();
}
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();
}
}
Aggregations