Search in sources :

Example 21 with PageStatus

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

the class StatusCellRenderer method render.

@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
    if (cellValue instanceof PageStatus) {
        PageStatus status = (PageStatus) cellValue;
        String tip = translator.translate(status.i18nKey());
        target.append("<i class='o_icon ").append(status.cssClass()).append(" o_icon-fw' title='").append(tip).append("'> </i>");
    } else if (cellValue instanceof SectionStatus) {
        SectionStatus status = (SectionStatus) cellValue;
        String tip = translator.translate(status.i18nKey());
        target.append("<i class='o_icon ").append(status.cssClass()).append(" o_icon-fw' title='").append(tip).append("'> </i>");
    }
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) SectionStatus(org.olat.modules.portfolio.SectionStatus)

Example 22 with PageStatus

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

the class SharedItemsOverviewController method doOpenPages.

private SharedPagesController doOpenPages(UserRequest ureq) {
    if (pagesCtrl == null) {
        SearchSharePagesParameters searchParams = new SearchSharePagesParameters();
        searchParams.setBookmarkOnly(false);
        searchParams.addExcludedPageStatus(PageStatus.closed, PageStatus.deleted);
        searchParams.addExcludedPageUserStatus(PageUserStatus.done);
        List<PageStatus> filters = new ArrayList<>(5);
        filters.add(PageStatus.draft);
        filters.add(PageStatus.inRevision);
        filters.add(PageStatus.published);
        WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance("Pages", 0l), null);
        pagesCtrl = new SharedPagesController(ureq, swControl, stackPanel, searchParams, filters, PageStatus.published);
        listenTo(pagesCtrl);
    } else {
        pagesCtrl.loadModel();
        addToHistory(ureq, pagesCtrl);
    }
    mainVC.put("segmentCmp", pagesCtrl.getInitialComponent());
    return pagesCtrl;
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) SearchSharePagesParameters(org.olat.modules.portfolio.model.SearchSharePagesParameters) ArrayList(java.util.ArrayList) WindowControl(org.olat.core.gui.control.WindowControl)

Example 23 with PageStatus

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

the class SharedItemsOverviewController method doOpenMark.

private SharedPagesController doOpenMark(UserRequest ureq) {
    if (bookmarkedPagesCtrl == null) {
        SearchSharePagesParameters searchParams = new SearchSharePagesParameters();
        searchParams.setBookmarkOnly(true);
        searchParams.addExcludedPageStatus(PageStatus.deleted);
        List<PageStatus> filters = new ArrayList<>(5);
        filters.add(PageStatus.draft);
        filters.add(PageStatus.inRevision);
        filters.add(PageStatus.published);
        filters.add(PageStatus.closed);
        WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance("Favorits", 0l), null);
        bookmarkedPagesCtrl = new SharedPagesController(ureq, swControl, stackPanel, searchParams, filters, null);
        listenTo(bookmarkedPagesCtrl);
    } else {
        bookmarkedPagesCtrl.loadModel();
        addToHistory(ureq, bookmarkedPagesCtrl);
    }
    mainVC.put("segmentCmp", bookmarkedPagesCtrl.getInitialComponent());
    return bookmarkedPagesCtrl;
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus) SearchSharePagesParameters(org.olat.modules.portfolio.model.SearchSharePagesParameters) ArrayList(java.util.ArrayList) WindowControl(org.olat.core.gui.control.WindowControl)

Example 24 with PageStatus

use of org.olat.modules.portfolio.PageStatus 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)

Example 25 with PageStatus

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

the class PageMetadataController method initStatus.

private void initStatus() {
    if (page.getSection() != null && page.getSection().getBinder() != null) {
        mainVC.contextPut("statusEnabled", Boolean.TRUE);
        PageStatus pageStatus = page.getPageStatus();
        if (pageStatus == null) {
            pageStatus = PageStatus.draft;
        }
        String status = translate("status." + pageStatus.name());
        mainVC.contextPut("pageStatus", status);
        if (secCallback.canPublish(page)) {
            publishButton = LinkFactory.createButtonSmall("publish", mainVC, this);
            publishButton.setIconLeftCSS("o_icon o_icon_publish o_icon-fw");
            publishButton.setElementCssClass("o_sel_pf_publish_entry");
        }
        if (secCallback.canRevision(page)) {
            revisionButton = LinkFactory.createButtonSmall("revision.page", mainVC, this);
            revisionButton.setIconLeftCSS("o_icon o_icon_rejected o_icon-fw");
            revisionButton.setElementCssClass("o_sel_pf_revision_entry");
            revisionButton.setTitle("revision.page.title");
        }
        if (secCallback.canClose(page)) {
            closeButton = LinkFactory.createButtonSmall("close.page", mainVC, this);
            closeButton.setIconLeftCSS("o_icon o_icon_status_done o_icon-fw");
            closeButton.setElementCssClass("o_sel_pf_close_entry");
            closeButton.setTitle("close.page.title");
        }
        if (secCallback.canReopen(page)) {
            reopenButton = LinkFactory.createButtonSmall("reopen.page", mainVC, this);
            reopenButton.setIconLeftCSS("o_icon o_icon_redo o_icon-fw");
            reopenButton.setElementCssClass("o_sel_pf_reopen_entry");
        }
    }
}
Also used : PageStatus(org.olat.modules.portfolio.PageStatus)

Aggregations

PageStatus (org.olat.modules.portfolio.PageStatus)30 PageUserStatus (org.olat.modules.portfolio.PageUserStatus)14 ArrayList (java.util.ArrayList)12 Date (java.util.Date)8 SectionStatus (org.olat.modules.portfolio.SectionStatus)8 AssessedPage (org.olat.modules.portfolio.model.AssessedPage)8 SearchSharePagesParameters (org.olat.modules.portfolio.model.SearchSharePagesParameters)8 List (java.util.List)6 Identity (org.olat.core.id.Identity)6 Page (org.olat.modules.portfolio.Page)6 AssessedBinder (org.olat.modules.portfolio.model.AssessedBinder)6 BigDecimal (java.math.BigDecimal)4 HashSet (java.util.HashSet)4 Map (java.util.Map)4 Set (java.util.Set)4 Collectors (java.util.stream.Collectors)4 TypedQuery (javax.persistence.TypedQuery)4 DB (org.olat.core.commons.persistence.DB)4 PersistenceHelper.appendFuzzyLike (org.olat.core.commons.persistence.PersistenceHelper.appendFuzzyLike)4 PersistenceHelper.makeFuzzyQueryString (org.olat.core.commons.persistence.PersistenceHelper.makeFuzzyQueryString)4