use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class AbstractPageListController method disposeRows.
protected void disposeRows() {
List<PortfolioElementRow> rows = model.getObjects();
if (rows != null && rows.size() > 0) {
for (PortfolioElementRow row : rows) {
if (row.getPoster() != null) {
row.getPoster().dispose();
row.setPoster(null);
}
}
}
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class AbstractPageListController method getComponents.
@Override
public final Iterable<Component> getComponents(int row, Object rowObject) {
PortfolioElementRow elRow = model.getObject(row);
List<Component> components = new ArrayList<>(4);
if (elRow.getNewEntryLink() != null) {
components.add(elRow.getNewEntryLink().getComponent());
}
if (elRow.getNewFloatingEntryLink() != null) {
components.add(elRow.getNewFloatingEntryLink().getComponent());
}
if (elRow.getNewAssignmentLink() != null) {
components.add(elRow.getNewAssignmentLink().getComponent());
}
if (elRow.getOpenFormItem() != null) {
components.add(elRow.getOpenFormItem().getComponent());
}
if (elRow.getReopenSectionLink() != null) {
components.add(elRow.getReopenSectionLink().getComponent());
}
if (elRow.getCloseSectionLink() != null) {
components.add(elRow.getCloseSectionLink().getComponent());
}
if (elRow.getEditAssignmentLink() != null) {
components.add(elRow.getEditAssignmentLink().getComponent());
}
if (elRow.getDeleteAssignmentLink() != null) {
components.add(elRow.getDeleteAssignmentLink().getComponent());
}
if (elRow.getUpAssignmentLink() != null) {
components.add(elRow.getUpAssignmentLink().getComponent());
}
if (elRow.getDownAssignmentLink() != null) {
components.add(elRow.getDownAssignmentLink().getComponent());
}
if (elRow.getMoveAssignmentLink() != null) {
components.add(elRow.getMoveAssignmentLink().getComponent());
}
if (elRow.getInstantiateAssignmentLink() != null) {
components.add(elRow.getInstantiateAssignmentLink().getComponent());
}
if (elRow.getCommentFormLink() != null) {
components.add(elRow.getCommentFormLink().getComponent());
}
if (elRow.getPoster() != null) {
components.add(elRow.getPoster());
}
if (elRow.getStartSelection() != null) {
components.add(elRow.getStartSelection().getComponent());
}
return components;
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class AbstractPageListController 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 ("Page".equalsIgnoreCase(resName) || "Entry".equalsIgnoreCase(resName)) {
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
PortfolioElementRow activatedRow = null;
for (PortfolioElementRow row : model.getObjects()) {
if (row.getKey() != null && row.getKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
doOpenRow(ureq, activatedRow, false);
}
} else if ("Section".equalsIgnoreCase(resName)) {
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
for (PortfolioElementRow row : model.getObjects()) {
if (row.getSection() != null && row.getSection().getKey().equals(resId)) {
// doOpenPage(ureq, row);
break;
}
}
}
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class BinderOnePageController method loadSection.
private void loadSection(Section section) {
String id = "section_" + (++counter);
VelocityContainer rowVC = createVelocityContainer(id, "portfolio_element_row");
AssessmentSection assessmentSection = null;
PortfolioElementRow row = new PortfolioElementRow(section, assessmentSection, false, false);
rowVC.contextPut("row", row);
rowVC.contextPut("rowIndex", 0);
mainVC.put(id, rowVC);
components.add(id);
}
use of org.olat.modules.portfolio.ui.model.PortfolioElementRow in project openolat by klemens.
the class DeletedPageListController method loadModel.
@Override
protected void loadModel(UserRequest ureq, String searchString) {
Map<Long, Long> numberOfCommentsMap = portfolioService.getNumberOfCommentsOnOwnedPage(getIdentity());
List<CategoryToElement> categorizedElements = portfolioService.getCategorizedOwnedPages(getIdentity());
Map<OLATResourceable, List<Category>> categorizedElementMap = new HashMap<>();
for (CategoryToElement categorizedElement : categorizedElements) {
List<Category> categories = categorizedElementMap.get(categorizedElement.getCategorizedResource());
if (categories == null) {
categories = new ArrayList<>();
categorizedElementMap.put(categorizedElement.getCategorizedResource(), categories);
}
categories.add(categorizedElement.getCategory());
}
List<Page> pages = portfolioService.searchDeletedPages(getIdentity(), searchString);
List<PortfolioElementRow> rows = new ArrayList<>(pages.size());
for (Page page : pages) {
rows.add(forgePageRow(ureq, page, null, null, categorizedElementMap, numberOfCommentsMap, true));
}
// clean up the posters
disposeRows();
model.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
deleteButton.setVisible(tableEl.getRendererType() == FlexiTableRendererType.classic && model.getRowCount() > 0);
}
Aggregations