Search in sources :

Example 31 with SectionRef

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

the class RestorePageController method getSelectedSection.

private SectionRef getSelectedSection() {
    SectionRef selectSection = null;
    if (sectionsEl != null && sectionsEl.isOneSelected() && sectionsEl.isEnabled() && sectionsEl.isVisible()) {
        String selectedKey = sectionsEl.getSelectedKey();
        selectSection = new SectionKeyRef(new Long(selectedKey));
    }
    return selectSection;
}
Also used : SectionKeyRef(org.olat.modules.portfolio.model.SectionKeyRef) SectionRef(org.olat.modules.portfolio.SectionRef)

Example 32 with SectionRef

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

the class SectionEditController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    if (section == null) {
        String title = titleEl.getValue();
        String description = descriptionEl.getValue();
        SectionRef sectionRef = portfolioService.appendNewSection(title, description, beginDateEl.getDate(), endDateEl.getDate(), binder);
        section = portfolioService.getSection(sectionRef);
    } else {
        Section reloadedSection = portfolioService.getSection(section);
        reloadedSection.setTitle(titleEl.getValue());
        reloadedSection.setDescription(descriptionEl.getValue());
        reloadedSection.setBeginDate(beginDateEl.getDate());
        reloadedSection.setEndDate(endDateEl.getDate());
        section = portfolioService.updateSection(reloadedSection);
    }
    fireEvent(ureq, Event.DONE_EVENT);
}
Also used : SectionRef(org.olat.modules.portfolio.SectionRef) Section(org.olat.modules.portfolio.Section)

Aggregations

SectionRef (org.olat.modules.portfolio.SectionRef)32 Section (org.olat.modules.portfolio.Section)24 Test (org.junit.Test)22 Identity (org.olat.core.id.Identity)22 Binder (org.olat.modules.portfolio.Binder)22 SynchedBinder (org.olat.modules.portfolio.model.SynchedBinder)22 Page (org.olat.modules.portfolio.Page)20 Assignment (org.olat.modules.portfolio.Assignment)16 RepositoryEntry (org.olat.repository.RepositoryEntry)16 ArrayList (java.util.ArrayList)8 SectionKeyRef (org.olat.modules.portfolio.model.SectionKeyRef)4 OLATResourceable (org.olat.core.id.OLATResourceable)2 PageImageAlign (org.olat.modules.portfolio.PageImageAlign)2