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