Search in sources :

Example 1 with FeedPreviewSecurityCallback

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");
            }
        }
    }
}
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 2 with FeedPreviewSecurityCallback

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

Aggregations

CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 FeedPreviewSecurityCallback (org.olat.modules.webFeed.FeedPreviewSecurityCallback)2 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)2