use of org.olat.modules.edubase.model.PositionComparator in project openolat by klemens.
the class EdubasePeekViewController method createPeekviewComponent.
private Component createPeekviewComponent(ModuleConfiguration modulConfiguration) {
VelocityContainer container = createVelocityContainer(PEEKVIEW_CONTAINER);
;
// BookSections
List<BookSection> bookSections = modulConfiguration.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSection.class).stream().sorted(new PositionComparator()).limit(NUMBER_BOOK_SECTION_DESC_DISABLED).collect(Collectors.toList());
container.contextPut("bookSections", bookSections);
// Add a link to show all BookSections (go to node)
Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", container, this);
allItemsLink.setIconRightCSS("o_icon o_icon_start");
allItemsLink.setCustomEnabledLinkCSS("pull-right");
return container;
}
use of org.olat.modules.edubase.model.PositionComparator in project openolat by klemens.
the class EdubaseRunController method createOverviewComponent.
private Component createOverviewComponent(ModuleConfiguration modulConfiguration) {
VelocityContainer container;
if (modulConfiguration.getBooleanSafe(EdubaseCourseNode.CONFIG_DESCRIPTION_ENABLED)) {
container = createVelocityContainer(OVERVIEW_DESCRIPTION_ENABLED);
} else {
container = createVelocityContainer(OVERVIEW_DESCRIPTION_DISABLED);
}
bookSections = modulConfiguration.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSection.class).stream().sorted(new PositionComparator()).collect(Collectors.toList());
container.contextPut("bookSections", bookSections);
for (BookSection bookSection : bookSections) {
Link nodeLink = LinkFactory.createLink("startReader_" + bookSection.getPosition(), container, this);
nodeLink.setCustomDisplayText(getTranslator().translate("open.document"));
nodeLink.setIconRightCSS("o_icon o_icon_start");
nodeLink.setUserObject(bookSection);
}
EdubaseViewHelper edubaseViewHelper = new EdubaseViewHelper(getTranslator());
container.contextPut("helper", edubaseViewHelper);
container.contextPut("run", EVENT_RUN);
return container;
}
use of org.olat.modules.edubase.model.PositionComparator in project OpenOLAT by OpenOLAT.
the class EdubaseRunController method createOverviewComponent.
private Component createOverviewComponent(ModuleConfiguration modulConfiguration) {
VelocityContainer container;
if (modulConfiguration.getBooleanSafe(EdubaseCourseNode.CONFIG_DESCRIPTION_ENABLED)) {
container = createVelocityContainer(OVERVIEW_DESCRIPTION_ENABLED);
} else {
container = createVelocityContainer(OVERVIEW_DESCRIPTION_DISABLED);
}
bookSections = modulConfiguration.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSection.class).stream().sorted(new PositionComparator()).collect(Collectors.toList());
container.contextPut("bookSections", bookSections);
for (BookSection bookSection : bookSections) {
Link nodeLink = LinkFactory.createLink("startReader_" + bookSection.getPosition(), container, this);
nodeLink.setCustomDisplayText(getTranslator().translate("open.document"));
nodeLink.setIconRightCSS("o_icon o_icon_start");
nodeLink.setUserObject(bookSection);
}
EdubaseViewHelper edubaseViewHelper = new EdubaseViewHelper(getTranslator());
container.contextPut("helper", edubaseViewHelper);
container.contextPut("run", EVENT_RUN);
return container;
}
use of org.olat.modules.edubase.model.PositionComparator in project OpenOLAT by OpenOLAT.
the class EdubaseBookSectionListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("pane.tab.book.section.list");
setFormContextHelp("KnowledgeTransfer#_edubase");
String page = velocity_root + "/bookSectionList.html";
bookSectionsCont = FormLayoutContainer.createCustomFormLayout("bookSections", getTranslator(), page);
bookSectionsCont.setRootForm(mainForm);
formLayout.add(bookSectionsCont);
// BookSections
List<BookSection> bookSections = new ArrayList<>(config.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSectionImpl.class));
bookSections.stream().sorted(new PositionComparator()).forEach(this::wrapBookSection);
ensureBookSectionWrappersHaveAnEntry();
bookSectionsCont.contextPut("bookSections", bookSectionWrappers);
recalculateUpDownLinks();
// Submit Button
FormLayoutContainer buttonLayout = FormLayoutContainer.createDefaultFormLayout_2_10("buttons", getTranslator());
buttonLayout.setRootForm(mainForm);
formLayout.add(buttonLayout);
uifactory.addFormSubmitButton("save", buttonLayout);
}
use of org.olat.modules.edubase.model.PositionComparator in project OpenOLAT by OpenOLAT.
the class EdubasePeekViewController method createPeekviewComponent.
private Component createPeekviewComponent(ModuleConfiguration modulConfiguration) {
VelocityContainer container = createVelocityContainer(PEEKVIEW_CONTAINER);
;
// BookSections
List<BookSection> bookSections = modulConfiguration.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSection.class).stream().sorted(new PositionComparator()).limit(NUMBER_BOOK_SECTION_DESC_DISABLED).collect(Collectors.toList());
container.contextPut("bookSections", bookSections);
// Add a link to show all BookSections (go to node)
Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", container, this);
allItemsLink.setIconRightCSS("o_icon o_icon_start");
allItemsLink.setCustomEnabledLinkCSS("pull-right");
return container;
}
Aggregations