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