use of org.olat.modules.portfolio.model.PageBodyImpl in project OpenOLAT by OpenOLAT.
the class PageDAO method createAndPersistPageBody.
public PageBody createAndPersistPageBody() {
PageBodyImpl body = new PageBodyImpl();
body.setCreationDate(new Date());
body.setLastModified(body.getCreationDate());
dbInstance.getCurrentEntityManager().persist(body);
return body;
}
use of org.olat.modules.portfolio.model.PageBodyImpl in project openolat by klemens.
the class PageDAO method moveUpPart.
public void moveUpPart(PageBody body, PagePart part) {
body.getParts().size();
int index = body.getParts().indexOf(part);
if (index > 0) {
PagePart reloadedPart = body.getParts().remove(index);
body.getParts().add(index - 1, reloadedPart);
} else if (index < 0) {
body.getParts().add(0, part);
}
((PageBodyImpl) body).setLastModified(new Date());
dbInstance.getCurrentEntityManager().merge(body);
}
use of org.olat.modules.portfolio.model.PageBodyImpl in project openolat by klemens.
the class PageDAO method removePart.
public void removePart(PageBody body, PagePart part) {
PagePart aPart = dbInstance.getCurrentEntityManager().getReference(part.getClass(), part.getKey());
body.getParts().size();
body.getParts().remove(aPart);
dbInstance.getCurrentEntityManager().remove(aPart);
((PageBodyImpl) body).setLastModified(new Date());
dbInstance.getCurrentEntityManager().merge(body);
}
use of org.olat.modules.portfolio.model.PageBodyImpl in project OpenOLAT by OpenOLAT.
the class PageDAO method removePart.
public void removePart(PageBody body, PagePart part) {
PagePart aPart = dbInstance.getCurrentEntityManager().getReference(part.getClass(), part.getKey());
body.getParts().size();
body.getParts().remove(aPart);
dbInstance.getCurrentEntityManager().remove(aPart);
((PageBodyImpl) body).setLastModified(new Date());
dbInstance.getCurrentEntityManager().merge(body);
}
use of org.olat.modules.portfolio.model.PageBodyImpl in project OpenOLAT by OpenOLAT.
the class PageDAO method moveUpPart.
public void moveUpPart(PageBody body, PagePart part) {
body.getParts().size();
int index = body.getParts().indexOf(part);
if (index > 0) {
PagePart reloadedPart = body.getParts().remove(index);
body.getParts().add(index - 1, reloadedPart);
} else if (index < 0) {
body.getParts().add(0, part);
}
((PageBodyImpl) body).setLastModified(new Date());
dbInstance.getCurrentEntityManager().merge(body);
}
Aggregations