Search in sources :

Example 86 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class VideoRunController method doLaunch.

private void doLaunch(UserRequest ureq) {
    VelocityContainer myContent = createVelocityContainer("run");
    if (videoRoot == null) {
        RepositoryEntry re = VideoEditController.getVideoReference(config, false);
        if (re == null) {
            showError(VideoEditController.NLS_ERROR_VIDEOREPOENTRYMISSING);
            return;
        }
    }
    RepositoryEntry videoEntry = videoNode.getReferencedRepositoryEntry();
    // configure the display controller according to config
    boolean autoplay = config.getBooleanSafe(VideoEditController.CONFIG_KEY_AUTOPLAY);
    boolean comments = config.getBooleanSafe(VideoEditController.CONFIG_KEY_COMMENTS);
    boolean ratings = config.getBooleanSafe(VideoEditController.CONFIG_KEY_RATING);
    String ident = videoNode.getIdent();
    String customtext = config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_CUSTOMTEXT);
    switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT, "none")) {
        case "resourceDescription":
            videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, false, false, "", userCourseEnv.isCourseReadOnly());
            break;
        case "customDescription":
            videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, customtext, userCourseEnv.isCourseReadOnly());
            break;
        case "none":
            videoDispCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, autoplay, comments, ratings, true, ident, true, false, "", userCourseEnv.isCourseReadOnly());
            break;
    }
    listenTo(videoDispCtr);
    myContent.put("videoDisplay", videoDispCtr.getInitialComponent());
    main.setContent(myContent);
    // Update launch counter
    repositoryService.incrementLaunchCounter(videoEntry);
}
Also used : VideoDisplayController(org.olat.modules.video.ui.VideoDisplayController) RepositoryEntry(org.olat.repository.RepositoryEntry) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 87 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class QTI21AssessmentTestStatisticsController method initScoreHistogram.

private void initScoreHistogram(StatisticAssessment stats) {
    int numOfParticipants = stats.getNumOfParticipants();
    VelocityContainer scoreHistogramVC = createVelocityContainer("histogram_score");
    scoreHistogramVC.setVisible(numOfParticipants > 0);
    scoreHistogramVC.contextPut("datas", BarSeries.datasToString(stats.getScores()));
    mainVC.put("scoreHistogram", scoreHistogramVC);
}
Also used : VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 88 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class QTI21AssessmentTestStatisticsController method initDurationHistogram.

private void initDurationHistogram(StatisticAssessment stats) {
    boolean visible = BarSeries.hasNotNullDatas(stats.getDurations()) && stats.getNumOfParticipants() > 0;
    VelocityContainer durationHistogramVC = createVelocityContainer("histogram_duration");
    durationHistogramVC.setVisible(visible);
    if (visible) {
        durationHistogramVC.contextPut("datas", BarSeries.datasToString(stats.getDurations()));
    }
    mainVC.put("durationHistogram", durationHistogramVC);
}
Also used : VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 89 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class ReadyToDeleteController method initializeContent.

private void initializeContent() {
    updateUserList();
    VelocityContainer readyToDeleteContent = createVelocityContainer("readyToDelete");
    readyToDeleteContent.put("readyToDelete", tableCtr.getInitialComponent());
    readyToDeleteContent.contextPut("header", translate("ready.to.delete.header", Integer.toString(UserDeletionManager.getInstance().getDeleteEmailDuration())));
    readyToDeletePanel.setContent(readyToDeleteContent);
}
Also used : VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 90 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class DENManageParticipantsController method createParticipantsMail.

private void createParticipantsMail(UserRequest ureq, List<Identity> participants) {
    VelocityContainer sendMessageVC = createVelocityContainer("sendmessage");
    ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
    ContactList contactList = new ContactList(translate("participants.message.to"));
    contactList.addAllIdentites(participants);
    cmsg.addEmailTo(contactList);
    removeAsListenerAndDispose(contactCtr);
    contactCtr = new ContactFormController(ureq, getWindowControl(), false, false, false, cmsg);
    listenTo(contactCtr);
    sendMessageVC.contextPut("title", translate("participants.message"));
    sendMessageVC.put("contactForm", contactCtr.getInitialComponent());
    removeAsListenerAndDispose(notificationCmc);
    notificationCmc = new CloseableModalController(getWindowControl(), "close", sendMessageVC);
    listenTo(notificationCmc);
    notificationCmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer) ContactMessage(org.olat.core.util.mail.ContactMessage)

Aggregations

VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)162 Component (org.olat.core.gui.components.Component)22 ArrayList (java.util.ArrayList)16 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)14 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)14 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)14 Link (org.olat.core.gui.components.link.Link)12 Panel (org.olat.core.gui.components.panel.Panel)12 UserRequest (org.olat.core.gui.UserRequest)10 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)10 List (java.util.List)8 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)8 WindowControl (org.olat.core.gui.control.WindowControl)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 Translator (org.olat.core.gui.translator.Translator)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 HashMap (java.util.HashMap)6 Collectors (java.util.stream.Collectors)6 Mapper (org.olat.core.dispatcher.mapper.Mapper)6 BarSeries (org.olat.core.gui.components.chart.BarSeries)6