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);
}
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();
}
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);
}
}
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;
}
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();
}
Aggregations