use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.
the class CPContentController method displayInfoPage.
/**
* displays a info page in the "content-area" of the cpEditor
*
* see: ../_content/infoPage.html
*/
protected void displayInfoPage() {
if (currentPage != null)
currentPage.setFile(null);
VelocityContainer infoVC = createVelocityContainer("infoPage");
infoVC.contextPut("infoChapterpage", translate("contentcontroller.infoChapterpage"));
mainPanel.setContent(infoVC);
}
use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class BinderOnePageController method loadPage.
private void loadPage(UserRequest ureq, Page page) {
String id = "page_w_" + (++counter);
VelocityContainer pageVC = createVelocityContainer(id, "page_content_print");
mainVC.put(id, pageVC);
components.add(id);
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
PageMetadataController metadatCtrl = new PageMetadataController(ureq, getWindowControl(), secCallback, page);
listenTo(metadatCtrl);
Component pageMetaCmp = metadatCtrl.getInitialComponent();
pageVC.put("meta", pageMetaCmp);
PageController pageCtrl = new PageController(ureq, getWindowControl(), new PortfolioPageProvider(page), renderingHints);
listenTo(pageCtrl);
pageCtrl.loadElements(ureq);
Component pageCmp = pageCtrl.getInitialComponent();
pageVC.put("page", pageCmp);
CommentAndRatingSecurityCallback commentSecCallback = new ReadOnlyCommentsSecurityCallback();
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, page.getKey());
UserCommentsController commentsCtrl = new UserCommentsController(ureq, getWindowControl(), ores, null, commentSecCallback);
listenTo(commentsCtrl);
if (commentsCtrl.getNumOfComments() > 0) {
pageVC.put("comments", commentsCtrl.getInitialComponent());
}
}
use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.
the class ExportBinderAsPDFResource method createResultHTML.
private String createResultHTML(Component content) {
String pagePath = Util.getPackageVelocityRoot(this.getClass()) + "/export.html";
VelocityContainer mainVC = new VelocityContainer("html", pagePath, translator, null);
mainVC.put("cmp", content);
mainVC.contextPut("bodyCssClass", "o_portfolio_export");
StringOutput sb = new StringOutput(32000);
URLBuilder ubu = new URLBuilder("auth", "1", "0");
Renderer renderer = Renderer.getInstance(mainVC, translator, ubu, new RenderResult(), new EmptyGlobalSettings());
VelocityRenderDecorator vrdec = new VelocityRenderDecorator(renderer, mainVC, sb);
mainVC.contextPut("r", vrdec);
renderer.render(sb, mainVC, null);
return sb.toString();
}
use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.
the class VideoListingController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
model = new VideoEntryDataModel(dataSource, columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
tableEl.setRendererType(FlexiTableRendererType.custom);
tableEl.setSearchEnabled(true);
tableEl.setCustomizeColumns(false);
tableEl.setElementCssClass("o_video_listing");
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
tableEl.setPageSize(24);
VelocityContainer row = createVelocityContainer("video_cell");
row.contextPut("imgUrl", imgUrl);
// sets its own DOM id in velocity container
row.setDomReplacementWrapperRequired(false);
tableEl.setRowRenderer(row, this);
tableEl.setCssDelegate(new VideoCssDelegate());
initSorters(tableEl);
tableEl.setAndLoadPersistedPreferences(ureq, "video-list");
}
Aggregations