Search in sources :

Example 1 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method doOpenBinder.

protected BinderController doOpenBinder(UserRequest ureq, BinderRef row) {
    SynchedBinder binder = portfolioService.loadAndSyncBinder(row);
    if (binder.isChanged()) {
        showInfo("warning.binder.synched");
    }
    BinderController selectedBinderCtrl = doOpenBinder(ureq, binder.getBinder());
    if (row instanceof BinderRow) {
        VFSLeaf image = portfolioService.getPosterImageLeaf(binder.getBinder());
        ((BinderRow) row).setBackgroundImage(image);
    }
    return selectedBinderCtrl;
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SynchedBinder(org.olat.modules.portfolio.model.SynchedBinder)

Example 2 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method forgePortfolioRow.

protected BinderRow forgePortfolioRow(BinderStatistics binderRow) {
    String openLinkId = "open_" + (++counter);
    FormLink openLink = uifactory.addFormLink(openLinkId, "open", "open", null, flc, Link.LINK);
    openLink.setIconRightCSS("o_icon o_icon_start");
    VFSLeaf image = portfolioService.getPosterImageLeaf(binderRow);
    BinderRow row = new BinderRow(binderRow, image, openLink);
    openLink.setUserObject(row);
    return row;
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 3 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method getSelectedRows.

protected List<BinderRow> getSelectedRows() {
    Set<Integer> indexes = tableEl.getMultiSelectedIndex();
    List<BinderRow> selectedRows = new ArrayList<>(indexes.size());
    for (Integer index : indexes) {
        BinderRow row = model.getObject(index.intValue());
        selectedRows.add(row);
    }
    return selectedRows;
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ArrayList(java.util.ArrayList)

Example 4 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method loadModel.

protected void loadModel() {
    List<BinderStatistics> binderRows = portfolioService.searchOwnedBinders(getIdentity());
    List<BinderRow> rows = new ArrayList<>(binderRows.size());
    for (BinderStatistics binderRow : binderRows) {
        rows.add(forgePortfolioRow(binderRow));
    }
    if (portfolioModule.isLearnerCanCreateBinders() || portfolioModule.isCanCreateBindersFromTemplate() || portfolioModule.isCanCreateBindersFromCourse()) {
        rows.add(new BinderRow());
    }
    model.setObjects(rows);
    tableEl.reset();
    tableEl.reloadData();
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ArrayList(java.util.ArrayList) BinderStatistics(org.olat.modules.portfolio.model.BinderStatistics)

Example 5 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class DeletedBinderController method doConfirmDelete.

private void doConfirmDelete(UserRequest ureq) {
    if (deleteBinderCtrl != null)
        return;
    List<BinderRow> rows = getSelectedRows();
    if (rows.isEmpty()) {
        showWarning("binder.atleastone");
    } else {
        List<BinderStatistics> stats = new ArrayList<>(rows.size());
        for (BinderRow row : rows) {
            stats.add(row.getStatistics());
        }
        deleteBinderCtrl = new ConfirmDeleteBinderController(ureq, getWindowControl(), stats);
        listenTo(deleteBinderCtrl);
        String title = translate("delete.binder");
        cmc = new CloseableModalController(getWindowControl(), null, deleteBinderCtrl.getInitialComponent(), true, title, true);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) BinderStatistics(org.olat.modules.portfolio.model.BinderStatistics)

Aggregations

BinderRow (org.olat.modules.portfolio.ui.model.BinderRow)20 ArrayList (java.util.ArrayList)10 BinderStatistics (org.olat.modules.portfolio.model.BinderStatistics)6 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)4 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)4 Component (org.olat.core.gui.components.Component)2 FlexiTableRenderEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableRenderEvent)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 SynchedBinder (org.olat.modules.portfolio.model.SynchedBinder)2