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>");
}
}
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;
}
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;
}
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;
}
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");
}
}
}
Aggregations