use of org.olat.modules.webFeed.FeedPreviewSecurityCallback 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.modules.webFeed.FeedPreviewSecurityCallback 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");
}
}
}
}
Aggregations