Search in sources :

Example 6 with PageBodyImpl

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

the class PageDAO method moveDownPart.

public void moveDownPart(PageBody body, PagePart part) {
    body.getParts().size();
    int index = body.getParts().indexOf(part);
    if (index >= 0 && index + 1 < body.getParts().size()) {
        PagePart reloadedPart = body.getParts().remove(index);
        body.getParts().add(index + 1, reloadedPart);
        ((PageBodyImpl) body).setLastModified(new Date());
        dbInstance.getCurrentEntityManager().merge(body);
    }
}
Also used : PagePart(org.olat.modules.portfolio.PagePart) PageBodyImpl(org.olat.modules.portfolio.model.PageBodyImpl) Date(java.util.Date)

Example 7 with PageBodyImpl

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

the class PageDAO method moveDownPart.

public void moveDownPart(PageBody body, PagePart part) {
    body.getParts().size();
    int index = body.getParts().indexOf(part);
    if (index >= 0 && index + 1 < body.getParts().size()) {
        PagePart reloadedPart = body.getParts().remove(index);
        body.getParts().add(index + 1, reloadedPart);
        ((PageBodyImpl) body).setLastModified(new Date());
        dbInstance.getCurrentEntityManager().merge(body);
    }
}
Also used : PagePart(org.olat.modules.portfolio.PagePart) PageBodyImpl(org.olat.modules.portfolio.model.PageBodyImpl) Date(java.util.Date)

Example 8 with PageBodyImpl

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

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;
}
Also used : PageBodyImpl(org.olat.modules.portfolio.model.PageBodyImpl) Date(java.util.Date)

Aggregations

Date (java.util.Date)8 PageBodyImpl (org.olat.modules.portfolio.model.PageBodyImpl)8 PagePart (org.olat.modules.portfolio.PagePart)6