Search in sources :

Example 11 with BinderRow

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

the class DeletedBinderController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof FlexiTableRenderEvent) {
            FlexiTableRenderEvent se = (FlexiTableRenderEvent) event;
            deleteButton.setVisible(se.getRendererType() == FlexiTableRendererType.classic && model.getRowCount() > 0);
            tableEl.setSelectAllEnable(tableEl.getRendererType() == FlexiTableRendererType.classic);
        } else if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("restore".equals(cmd)) {
                BinderRow row = model.getObject(se.getIndex());
                doConfirmRestoreBinder(ureq, row);
            }
        }
    } else if (deleteButton == source) {
        doConfirmDelete(ureq);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableRenderEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableRenderEvent)

Example 12 with BinderRow

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

the class DeletedBinderController method loadModel.

@Override
protected void loadModel() {
    List<BinderStatistics> binderRows = portfolioService.searchOwnedDeletedBinders(getIdentity());
    List<BinderRow> rows = new ArrayList<>(binderRows.size());
    for (BinderStatistics binderRow : binderRows) {
        rows.add(forgePortfolioRow(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 13 with BinderRow

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

the class PortfolioHomeController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (myBindersLink == source) {
        BinderListController bindersCtrl = doOpenMyBinders(ureq);
        if (!portfolioModule.isLearnerCanCreateBinders() && bindersCtrl.getNumOfBinders() == 1) {
            BinderRow row = bindersCtrl.getFirstBinder();
            OLATResourceable resource = OresHelper.createOLATResourceableInstance(Binder.class, row.getKey());
            List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromString(resource);
            bindersCtrl.activate(ureq, entries, null);
        }
    } else if (myEntriesLink == source) {
        doOpenMyPages(ureq);
    } else if (mySharedItemsLink == source) {
        doOpenMySharedItems(ureq);
    } else if (sharedItemsLink == source) {
        doOpenSharedWithMe(ureq).activate(ureq, null, null);
    } else if (mediaCenterLink == source) {
        doOpenMediaCenter(ureq);
    } else if (editLastEntryLink == source) {
        doOpenLastEntry(ureq);
    } else if (createNewEntryLink == source) {
        doNewEntry(ureq);
    } else if (showHelpLink == source) {
    } else if (goToTrashLink == source) {
        doDeletedPages(ureq);
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 14 with BinderRow

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

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 15 with BinderRow

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

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)

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