use of org.olat.modules.portfolio.model.MySharedItemRow in project OpenOLAT by OpenOLAT.
the class MySharedItemsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
MySharedItemRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
Activateable2 activateable = doSelectBinder(ureq, row);
if (activateable != null) {
activateable.activate(ureq, null, null);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(se.getSearch());
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.model.MySharedItemRow in project OpenOLAT by OpenOLAT.
the class MySharedItemsController method loadModel.
private void loadModel(String searchString) {
List<Binder> portfolios = portfolioService.searchSharedBindersBy(getIdentity(), searchString);
List<MySharedItemRow> rows = new ArrayList<>(portfolios.size());
for (Binder binder : portfolios) {
MySharedItemRow row = new MySharedItemRow();
row.setBinderKey(binder.getKey());
row.setBinderTitle(binder.getTitle());
// TODO max()
row.setLastModified(binder.getLastModified());
if (binder.getEntry() != null) {
row.setCourseDisplayName(binder.getEntry().getDisplayname());
}
rows.add(row);
}
model.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
}
use of org.olat.modules.portfolio.model.MySharedItemRow in project OpenOLAT by OpenOLAT.
the class MySharedItemsController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Binder".equalsIgnoreCase(resName)) {
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
MySharedItemRow activatedRow = null;
for (MySharedItemRow row : model.getObjects()) {
if (row.getBinderKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
Activateable2 activeateable = doSelectBinder(ureq, activatedRow);
if (activeateable != null) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
activeateable.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
}
use of org.olat.modules.portfolio.model.MySharedItemRow in project openolat by klemens.
the class MySharedItemsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
MySharedItemRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
Activateable2 activateable = doSelectBinder(ureq, row);
if (activateable != null) {
activateable.activate(ureq, null, null);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(se.getSearch());
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.model.MySharedItemRow in project openolat by klemens.
the class MySharedItemsController method loadModel.
private void loadModel(String searchString) {
List<Binder> portfolios = portfolioService.searchSharedBindersBy(getIdentity(), searchString);
List<MySharedItemRow> rows = new ArrayList<>(portfolios.size());
for (Binder binder : portfolios) {
MySharedItemRow row = new MySharedItemRow();
row.setBinderKey(binder.getKey());
row.setBinderTitle(binder.getTitle());
// TODO max()
row.setLastModified(binder.getLastModified());
if (binder.getEntry() != null) {
row.setCourseDisplayName(binder.getEntry().getDisplayname());
}
rows.add(row);
}
model.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
}
Aggregations