Search in sources :

Example 6 with PageUserStatus

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

the class SharedPageStatusCellRenderer method renderPageRow.

public String renderPageRow(PageRow pageRow) {
    if (pageRow == null || pageRow.getPage() == null)
        return "";
    StringOutput target = new StringOutput(64);
    PageStatus pageStatus = pageRow.getPage().getPageStatus();
    PageUserStatus userStatus = pageRow.getUserInfosStatus();
    render(target, pageStatus, userStatus);
    return target.toString();
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) PageUserStatus(org.olat.modules.portfolio.PageUserStatus) StringOutput(org.olat.core.gui.render.StringOutput)

Example 7 with PageUserStatus

use of org.olat.modules.portfolio.PageUserStatus in project OpenOLAT by OpenOLAT.

the class PageMetadataController method syncUserInfosStatus.

private void syncUserInfosStatus() {
    PageStatus status = page.getPageStatus();
    PageUserStatus userStatus = pageUserInfos.getStatus();
    if ((status == PageStatus.inRevision || status == PageStatus.published) && (userStatus == null || userStatus == PageUserStatus.incoming)) {
        pageUserInfos.setStatus(PageUserStatus.inProcess);
    } else if ((status == PageStatus.closed || status == PageStatus.deleted) && (userStatus != PageUserStatus.done)) {
        pageUserInfos.setStatus(PageUserStatus.done);
    }
    pageUserInfos.setRecentLaunch(new Date());
    pageUserInfos = portfolioService.updatePageUserInfos(pageUserInfos);
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) PageUserStatus(org.olat.modules.portfolio.PageUserStatus) Date(java.util.Date)

Example 8 with PageUserStatus

use of org.olat.modules.portfolio.PageUserStatus in project OpenOLAT by OpenOLAT.

the class SharedPageStatusCellRenderer method renderPageRow.

public String renderPageRow(PageRow pageRow) {
    if (pageRow == null || pageRow.getPage() == null)
        return "";
    StringOutput target = new StringOutput(64);
    PageStatus pageStatus = pageRow.getPage().getPageStatus();
    PageUserStatus userStatus = pageRow.getUserInfosStatus();
    render(target, pageStatus, userStatus);
    return target.toString();
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) PageUserStatus(org.olat.modules.portfolio.PageUserStatus) StringOutput(org.olat.core.gui.render.StringOutput)

Example 9 with PageUserStatus

use of org.olat.modules.portfolio.PageUserStatus in project OpenOLAT by OpenOLAT.

the class SharedPageStatusCellRenderer method renderPortfolioElementRow.

public String renderPortfolioElementRow(PortfolioElementRow elementRow) {
    if (elementRow == null || elementRow.getPage() == null)
        return "";
    StringOutput target = new StringOutput(64);
    PageStatus pageStatus = elementRow.getPage().getPageStatus();
    PageUserStatus userStatus = elementRow.getUserInfosStatus();
    render(target, pageStatus, userStatus);
    return target.toString();
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) PageUserStatus(org.olat.modules.portfolio.PageUserStatus) StringOutput(org.olat.core.gui.render.StringOutput)

Example 10 with PageUserStatus

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

the class PortfolioServiceImpl method getPageUserInfos.

@Override
public PageUserInformations getPageUserInfos(Page page, Identity identity, PageUserStatus defaultStatus) {
    PageUserInformations infos = pageUserInfosDao.getPageUserInfos(page, identity);
    if (infos == null) {
        PageStatus status = page.getPageStatus();
        PageUserStatus userStatus = defaultStatus;
        if (status == null || status == PageStatus.draft) {
            userStatus = PageUserStatus.incoming;
        } else if (status == PageStatus.closed || status == PageStatus.deleted) {
            userStatus = PageUserStatus.done;
        }
        infos = pageUserInfosDao.create(userStatus, page, identity);
    }
    return infos;
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) PageUserStatus(org.olat.modules.portfolio.PageUserStatus) PageUserInformations(org.olat.modules.portfolio.PageUserInformations)

Aggregations

PageStatus (org.olat.modules.portfolio.PageStatus)12 PageUserStatus (org.olat.modules.portfolio.PageUserStatus)12 Date (java.util.Date)4 StringOutput (org.olat.core.gui.render.StringOutput)4 BigDecimal (java.math.BigDecimal)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 TypedQuery (javax.persistence.TypedQuery)2 DB (org.olat.core.commons.persistence.DB)2 PersistenceHelper.appendFuzzyLike (org.olat.core.commons.persistence.PersistenceHelper.appendFuzzyLike)2 PersistenceHelper.makeFuzzyQueryString (org.olat.core.commons.persistence.PersistenceHelper.makeFuzzyQueryString)2 Identity (org.olat.core.id.Identity)2 StringHelper (org.olat.core.util.StringHelper)2 BinderStatus (org.olat.modules.portfolio.BinderStatus)2 PageUserInformations (org.olat.modules.portfolio.PageUserInformations)2 PortfolioRoles (org.olat.modules.portfolio.PortfolioRoles)2