Search in sources :

Example 6 with LectureBlockRow

use of org.olat.modules.lecture.model.LectureBlockRow in project OpenOLAT by OpenOLAT.

the class TeacherToolOverviewController method getRows.

@Override
protected List<LectureBlockRow> getRows(LecturesBlockSearchParameters searchParams) {
    List<LectureBlock> blocksWithTeachers = lectureService.getLectureBlocks(getIdentity(), searchParams);
    List<LectureBlockRow> rows = new ArrayList<>(blocksWithTeachers.size());
    for (LectureBlock block : blocksWithTeachers) {
        RepositoryEntry entry = block.getEntry();
        rows.add(new LectureBlockRow(block, entry.getDisplayname(), entry.getExternalRef(), "", true));
    }
    return rows;
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Example 7 with LectureBlockRow

use of org.olat.modules.lecture.model.LectureBlockRow in project OpenOLAT by OpenOLAT.

the class TeacherOverviewController method getRows.

@Override
protected List<LectureBlockRow> getRows(LecturesBlockSearchParameters searchParams) {
    Identity filterByTeacher = ((Boolean) allTeachersSwitch.getUserObject()).booleanValue() ? null : getIdentity();
    List<LectureBlockWithTeachers> blocksWithTeachers = lectureService.getLectureBlocksWithTeachers(entry, filterByTeacher, searchParams);
    // only show the start button if
    List<LectureBlockRow> rows = new ArrayList<>(blocksWithTeachers.size());
    if (ConfigurationHelper.isRollCallEnabled(entryConfig, lectureModule)) {
        for (LectureBlockWithTeachers blockWithTeachers : blocksWithTeachers) {
            LectureBlock block = blockWithTeachers.getLectureBlock();
            StringBuilder teachers = new StringBuilder(32);
            List<Identity> teacherList = blockWithTeachers.getTeachers();
            String separator = translate("user.fullname.separator");
            for (Identity teacher : blockWithTeachers.getTeachers()) {
                if (teachers.length() > 0)
                    teachers.append(" ").append(separator).append(" ");
                teachers.append(userManager.getUserDisplayName(teacher));
            }
            rows.add(new LectureBlockRow(block, entry.getDisplayname(), entry.getExternalRef(), teachers.toString(), teacherList.contains(getIdentity())));
        }
    }
    return rows;
}
Also used : LectureBlockWithTeachers(org.olat.modules.lecture.model.LectureBlockWithTeachers) LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Example 8 with LectureBlockRow

use of org.olat.modules.lecture.model.LectureBlockRow in project openolat by klemens.

the class LectureListRepositoryController method loadModel.

private void loadModel() {
    List<LectureBlockWithTeachers> blocks = lectureService.getLectureBlocksWithTeachers(entry);
    List<LectureBlockRow> rows = new ArrayList<>(blocks.size());
    for (LectureBlockWithTeachers block : blocks) {
        LectureBlock b = block.getLectureBlock();
        StringBuilder teachers = new StringBuilder();
        String separator = translate("user.fullname.separator");
        for (Identity teacher : block.getTeachers()) {
            if (teachers.length() > 0)
                teachers.append(" ").append(separator).append(" ");
            teachers.append(userManager.getUserDisplayName(teacher));
        }
        LectureBlockRow row = new LectureBlockRow(b, entry.getDisplayname(), entry.getExternalRef(), teachers.toString(), false);
        rows.add(row);
        String linkName = "tools-" + counter++;
        FormLink toolsLink = uifactory.addFormLink(linkName, "", null, flc, Link.LINK | Link.NONTRANSLATED);
        toolsLink.setIconRightCSS("o_icon o_icon_actions o_icon-lg");
        toolsLink.setUserObject(row);
        flc.add(linkName, toolsLink);
        row.setToolsLink(toolsLink);
    }
    tableModel.setObjects(rows);
    tableEl.reset(true, true, true);
    deleteLecturesButton.setVisible(!rows.isEmpty());
}
Also used : LectureBlockWithTeachers(org.olat.modules.lecture.model.LectureBlockWithTeachers) LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Example 9 with LectureBlockRow

use of org.olat.modules.lecture.model.LectureBlockRow in project openolat by klemens.

the class TeacherLecturesTableController method loadModel.

protected void loadModel(List<LectureBlockRow> blocks) {
    for (LectureBlockRow row : blocks) {
        FormLink toolsLink = uifactory.addFormLink("tools_" + (counter++), "tools", "", null, null, Link.NONTRANSLATED);
        toolsLink.setIconLeftCSS("o_icon o_icon-lg o_icon_actions");
        toolsLink.setUserObject(row);
        row.setToolsLink(toolsLink);
    }
    tableModel.setObjects(blocks);
    tableEl.reset(true, true, true);
}
Also used : FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Example 10 with LectureBlockRow

use of org.olat.modules.lecture.model.LectureBlockRow in project openolat by klemens.

the class TeacherOverviewController method getRows.

@Override
protected List<LectureBlockRow> getRows(LecturesBlockSearchParameters searchParams) {
    Identity filterByTeacher = ((Boolean) allTeachersSwitch.getUserObject()).booleanValue() ? null : getIdentity();
    List<LectureBlockWithTeachers> blocksWithTeachers = lectureService.getLectureBlocksWithTeachers(entry, filterByTeacher, searchParams);
    // only show the start button if
    List<LectureBlockRow> rows = new ArrayList<>(blocksWithTeachers.size());
    if (ConfigurationHelper.isRollCallEnabled(entryConfig, lectureModule)) {
        for (LectureBlockWithTeachers blockWithTeachers : blocksWithTeachers) {
            LectureBlock block = blockWithTeachers.getLectureBlock();
            StringBuilder teachers = new StringBuilder(32);
            List<Identity> teacherList = blockWithTeachers.getTeachers();
            String separator = translate("user.fullname.separator");
            for (Identity teacher : blockWithTeachers.getTeachers()) {
                if (teachers.length() > 0)
                    teachers.append(" ").append(separator).append(" ");
                teachers.append(userManager.getUserDisplayName(teacher));
            }
            rows.add(new LectureBlockRow(block, entry.getDisplayname(), entry.getExternalRef(), teachers.toString(), teacherList.contains(getIdentity())));
        }
    }
    return rows;
}
Also used : LectureBlockWithTeachers(org.olat.modules.lecture.model.LectureBlockWithTeachers) LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Aggregations

LectureBlockRow (org.olat.modules.lecture.model.LectureBlockRow)20 ArrayList (java.util.ArrayList)12 LectureBlock (org.olat.modules.lecture.LectureBlock)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)8 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 Identity (org.olat.core.id.Identity)4 LectureBlockWithTeachers (org.olat.modules.lecture.model.LectureBlockWithTeachers)4 Date (java.util.Date)2 List (java.util.List)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2