use of org.olat.modules.portfolio.model.SharedItemRow in project openolat by klemens.
the class SharedBindersController 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();
SharedItemRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
Activateable2 activeateable = doSelectBinder(ureq, row);
if (activeateable != null) {
activeateable.activate(ureq, null, null);
}
} else if ("leave".equals(cmd)) {
doConfirmLeaveBinder(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(se.getSearch());
} else if ("ONCLICK".equals(event.getCommand())) {
String row = ureq.getParameter("select-section");
String expand = ureq.getParameter("expand-section");
if (StringHelper.isLong(row)) {
doSelectSection(ureq);
} else if (StringHelper.containsNonWhitespace(expand)) {
doExpandSections(ureq);
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.model.SharedItemRow in project OpenOLAT by OpenOLAT.
the class SharedBindersController method doSelectSection.
private void doSelectSection(UserRequest ureq) {
try {
String row = ureq.getParameter("select-section");
int index = Integer.parseInt(row);
SharedItemRow itemRow = model.getObject(index);
if (itemRow != null) {
String sectionParam = ureq.getParameter("section");
int sectionIndex = Integer.parseInt(sectionParam);
AssessedBinderSection section = itemRow.getSections().get(sectionIndex);
Activateable2 activeateable = doSelectBinder(ureq, itemRow);
if (activeateable != null) {
List<ContextEntry> entries = new ArrayList<>(2);
entries.add(BusinessControlFactory.getInstance().createContextEntry(OresHelper.createOLATResourceableInstance("Entries", 0l)));
entries.add(BusinessControlFactory.getInstance().createContextEntry(OresHelper.createOLATResourceableInstance("Section", section.getSectionKey())));
activeateable.activate(ureq, entries, null);
}
}
} catch (Exception e) {
logError("", e);
}
}
use of org.olat.modules.portfolio.model.SharedItemRow in project OpenOLAT by OpenOLAT.
the class SharedBindersController 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();
SharedItemRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
Activateable2 activeateable = doSelectBinder(ureq, row);
if (activeateable != null) {
activeateable.activate(ureq, null, null);
}
} else if ("leave".equals(cmd)) {
doConfirmLeaveBinder(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(se.getSearch());
} else if ("ONCLICK".equals(event.getCommand())) {
String row = ureq.getParameter("select-section");
String expand = ureq.getParameter("expand-section");
if (StringHelper.isLong(row)) {
doSelectSection(ureq);
} else if (StringHelper.containsNonWhitespace(expand)) {
doExpandSections(ureq);
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.model.SharedItemRow in project OpenOLAT by OpenOLAT.
the class SharedBindersController method loadModel.
private void loadModel(String searchString) {
List<AssessedBinder> assessedBinders = portfolioService.searchSharedBindersWith(getIdentity(), searchString);
List<SharedItemRow> rows = new ArrayList<>(assessedBinders.size());
for (AssessedBinder assessedBinder : assessedBinders) {
SharedItemRow row = new SharedItemRow(assessedBinder.getAssessedIdentity(), userPropertyHandlers, getLocale());
row.setBinderTitle(assessedBinder.getBinderTitle());
row.setBinderKey(assessedBinder.getBinderKey());
row.setLastModified(assessedBinder.getLastModified());
row.setEntryDisplayName(assessedBinder.getEntryDisplayname());
row.setAssessmentEntry(assessedBinder);
row.setRecentLaunch(assessedBinder.getRecentLaunch());
List<AssessedBinderSection> sections = assessedBinder.getSections();
if (sections != null && sections.size() > 1) {
Collections.sort(sections, new AssessedBinderSectionComparator());
}
row.setSections(sections);
row.setNumOfOpenSections(assessedBinder.getNumOfOpenSections());
row.setNumOfDraftPages(assessedBinder.getNumOfDraftPages());
row.setNumOfInRevisionPages(assessedBinder.getNumOfInRevisionPages());
row.setNumOfClosedPages(assessedBinder.getNumOfClosedPages());
row.setNumOfNewlyPublishedPages(assessedBinder.getNumOfNewlyPublishedPages());
rows.add(row);
}
model.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
}
use of org.olat.modules.portfolio.model.SharedItemRow in project openolat by klemens.
the class SharedBindersController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (confirmLeaveCtrl == source) {
if (DialogBoxUIFactory.isOkEvent(event) || DialogBoxUIFactory.isYesEvent(event)) {
SharedItemRow row = (SharedItemRow) confirmLeaveCtrl.getUserObject();
doLeaveBinder(row);
}
}
super.event(ureq, source, event);
}
Aggregations