use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class BinderPageListController method updateTimeline.
private void updateTimeline() {
List<PortfolioElementRow> pages = model.getObjects();
List<TimelinePoint> points = new ArrayList<>(pages.size());
for (PortfolioElementRow page : pages) {
if (page.isPage()) {
String s = page.getPageStatus() == null ? "draft" : page.getPageStatus().name();
points.add(new TimelinePoint(page.getKey().toString(), page.getTitle(), page.getCreationDate(), s));
}
}
timelineEl.setPoints(points);
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class BinderPageListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof FlexiTableRenderEvent) {
FlexiTableRenderEvent re = (FlexiTableRenderEvent) event;
if (re.getRendererType() == FlexiTableRendererType.custom) {
tableEl.sort(new SortKey(null, false));
}
} else if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("select-page".equals(cmd)) {
PortfolioElementRow row = model.getObject(se.getIndex());
if (row.isPendingAssignment()) {
doStartAssignment(ureq, row);
} else {
doOpenRow(ureq, row, false);
}
}
}
} else if (previousSectionLink == source) {
Section previousSection = (Section) previousSectionLink.getUserObject();
doFilterSection(previousSection);
} else if (nextSectionLink == source) {
Section nextSection = (Section) nextSectionLink.getUserObject();
doFilterSection(nextSection);
} else if (showAllSectionsLink == source) {
doShowAll();
} else if (newSectionButton == source) {
doCreateNewSection(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("new.entry".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doCreateNewPage(ureq, row.getSection());
} else if ("new.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doCreateNewAssignment(ureq, row.getSection());
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class BinderPageListController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
super.activate(ureq, entries, state);
if (entries == null || entries.isEmpty())
return;
String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Section".equalsIgnoreCase(resName)) {
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
PortfolioElementRow activatedRow = null;
for (PortfolioElementRow row : model.getObjects()) {
if (row.getSection() != null && row.getSection().getKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
doFilterSection(activatedRow.getSection());
}
}
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class AbstractPageListController method getSelectedRows.
protected List<PortfolioElementRow> getSelectedRows() {
Set<Integer> indexes = tableEl.getMultiSelectedIndex();
List<PortfolioElementRow> selectedRows = new ArrayList<>(indexes.size());
for (Integer index : indexes) {
PortfolioElementRow row = model.getObject(index.intValue());
selectedRows.add(row);
}
return selectedRows;
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class AbstractPageListController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (pageCtrl == source) {
if (event == Event.CHANGED_EVENT) {
loadModel(ureq, null);
fireEvent(ureq, Event.CHANGED_EVENT);
} else if (event instanceof PageRemovedEvent) {
loadModel(ureq, null);
stackPanel.popUpToController(this);
fireEvent(ureq, Event.CHANGED_EVENT);
} else if (event instanceof PageDeletedEvent) {
loadModel(ureq, null);
fireEvent(ureq, event);
}
} else if (commentsCtrl == source) {
if (event == Event.CHANGED_EVENT || "comment_count_changed".equals(event.getCommand())) {
loadModel(ureq, null);
fireEvent(ureq, Event.CHANGED_EVENT);
}
cmc.deactivate();
cleanUp();
} else if (editAssignmentCtrl == source || moveAssignmentCtrl == source) {
if (event == Event.CHANGED_EVENT || event == Event.DONE_EVENT) {
loadModel(ureq, null);
fireEvent(ureq, Event.CHANGED_EVENT);
}
cmc.deactivate();
cleanUp();
} else if (confirmCloseSectionCtrl == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
PortfolioElementRow row = (PortfolioElementRow) confirmCloseSectionCtrl.getUserObject();
doClose(ureq, row);
}
} else if (confirmReopenSectionCtrl == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
PortfolioElementRow row = (PortfolioElementRow) confirmReopenSectionCtrl.getUserObject();
doReopen(ureq, row);
}
} else if (confirmDeleteAssignmentCtrl == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
PortfolioElementRow row = (PortfolioElementRow) confirmDeleteAssignmentCtrl.getUserObject();
doDelete(row);
loadModel(ureq, null);
}
} else if (cmc == source) {
cleanUp();
}
super.event(ureq, source, event);
}
Aggregations