Search in sources :

Example 1 with SectionRefImpl

use of org.olat.modules.portfolio.model.SectionRefImpl in project OpenOLAT by OpenOLAT.

the class TableOfContentController 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 pageKey = entries.get(0).getOLATResourceable().getResourceableId();
        Page page = portfolioService.getPageByKey(pageKey);
        if (page != null && page.getSection() != null && binder.equals(page.getSection().getBinder())) {
            Activateable2 activateable = doOpenPage(ureq, page);
            if (activateable != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                activateable.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        }
    } else if ("Section".equalsIgnoreCase(resName)) {
        Long sectionKey = entries.get(0).getOLATResourceable().getResourceableId();
        Section section = portfolioService.getSection(new SectionRefImpl(sectionKey));
        if (section != null && binder.equals(section.getBinder())) {
            doOpenSection(ureq, section);
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) Page(org.olat.modules.portfolio.Page) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section) SectionRefImpl(org.olat.modules.portfolio.model.SectionRefImpl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 2 with SectionRefImpl

use of org.olat.modules.portfolio.model.SectionRefImpl in project openolat by klemens.

the class TableOfContentController 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 pageKey = entries.get(0).getOLATResourceable().getResourceableId();
        Page page = portfolioService.getPageByKey(pageKey);
        if (page != null && page.getSection() != null && binder.equals(page.getSection().getBinder())) {
            Activateable2 activateable = doOpenPage(ureq, page);
            if (activateable != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                activateable.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        }
    } else if ("Section".equalsIgnoreCase(resName)) {
        Long sectionKey = entries.get(0).getOLATResourceable().getResourceableId();
        Section section = portfolioService.getSection(new SectionRefImpl(sectionKey));
        if (section != null && binder.equals(section.getBinder())) {
            doOpenSection(ureq, section);
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) Page(org.olat.modules.portfolio.Page) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section) SectionRefImpl(org.olat.modules.portfolio.model.SectionRefImpl) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 AssessmentSection (org.olat.modules.portfolio.AssessmentSection)2 Page (org.olat.modules.portfolio.Page)2 Section (org.olat.modules.portfolio.Section)2 SectionRefImpl (org.olat.modules.portfolio.model.SectionRefImpl)2