use of org.olat.modules.portfolio.model.PageImpl in project openolat by klemens.
the class BinderDAO method syncMovedAssignment.
private void syncMovedAssignment(SectionImpl currentSection, SectionImpl newSection, Assignment assignment) {
currentSection.getAssignments().size();
newSection.getAssignments().size();
currentSection.getAssignments().remove(assignment);
((AssignmentImpl) assignment).setSection(newSection);
assignment = dbInstance.getCurrentEntityManager().merge(assignment);
newSection.getAssignments().add(assignment);
Page page = assignment.getPage();
if (page != null) {
currentSection.getPages().remove(page);
newSection.getPages().add(page);
((PageImpl) page).setSection(newSection);
dbInstance.getCurrentEntityManager().merge(page);
}
}
use of org.olat.modules.portfolio.model.PageImpl in project openolat by klemens.
the class PortfolioServiceImpl method changeSectionStatus.
@Override
public Section changeSectionStatus(Section section, SectionStatus status, Identity coach) {
PageStatus newPageStatus;
if (status == SectionStatus.closed) {
newPageStatus = PageStatus.closed;
} else {
newPageStatus = PageStatus.inRevision;
}
Section reloadedSection = binderDao.loadSectionByKey(section.getKey());
List<Page> pages = reloadedSection.getPages();
for (Page page : pages) {
if (page != null) {
((PageImpl) page).setPageStatus(newPageStatus);
pageDao.updatePage(page);
if (newPageStatus == PageStatus.closed) {
// set user informations to done
pageUserInfosDao.updateStatus(page, PageUserStatus.done);
}
}
}
((SectionImpl) reloadedSection).setSectionStatus(status);
reloadedSection = binderDao.updateSection(reloadedSection);
return reloadedSection;
}
Aggregations