Search in sources :

Example 71 with Binder

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

the class ExportBinderAsPDFResource method prepare.

@Override
public void prepare(HttpServletResponse hres) {
    try {
        hres.setCharacterEncoding("UTF-8");
    } catch (Exception e) {
        log.error("", e);
    }
    htmlDir = prepareHtml();
    pdfFile = renderPdf(htmlDir);
    String label;
    if (selectedPage != null) {
        label = selectedPage.getTitle();
    } else {
        Binder binder = portfolioService.getBinderByKey(binderRef.getKey());
        label = binder.getTitle();
    }
    String secureLabel = StringHelper.transformDisplayNameToFileSystemName(label);
    String file = secureLabel + ".pdf";
    hres.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + StringHelper.urlEncodeUTF8(file));
    hres.setHeader("Content-Description", StringHelper.urlEncodeUTF8(label));
}
Also used : Binder(org.olat.modules.portfolio.Binder) FileNotFoundException(java.io.FileNotFoundException) SAXException(org.xml.sax.SAXException) IOException(java.io.IOException)

Example 72 with Binder

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

the class PageRunController method doEditMetadata.

private void doEditMetadata(UserRequest ureq) {
    if (editMetadataCtrl != null)
        return;
    removeAsListenerAndDispose(editMetadataCtrl);
    Binder binder = null;
    Section section = null;
    if (page.getSection() != null) {
        section = page.getSection();
        binder = portfolioService.getBinderBySection(section);
    }
    boolean editMetadata = secCallback.canEditPageMetadata(page, assignments);
    editMetadataCtrl = new PageMetadataEditController(ureq, getWindowControl(), binder, editMetadata, section, editMetadata, page, editMetadata);
    listenTo(editMetadataCtrl);
    String title = translate("edit.page.metadata");
    cmc = new CloseableModalController(getWindowControl(), null, editMetadataCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : Binder(org.olat.modules.portfolio.Binder) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) Section(org.olat.modules.portfolio.Section)

Example 73 with Binder

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

the class PageMetadataEditController method initBinderSelection.

protected void initBinderSelection() {
    if (chooseBinder) {
        List<Binder> binders = portfolioService.getOwnedBinders(getIdentity());
        String[] theKeys = new String[binders.size() + 1];
        String[] theValues = new String[binders.size() + 1];
        theKeys[0] = "none";
        theValues[0] = translate("binder.none");
        for (int i = 0; i < binders.size(); ++i) {
            Binder binder = binders.get(i);
            theKeys[i + 1] = binder.getKey().toString();
            theValues[i + 1] = binder.getTitle();
        }
        bindersEl.setKeysAndValues(theKeys, theValues, null);
        bindersEl.addActionListener(FormEvent.ONCHANGE);
        bindersEl.reset();
        String selectedBinder = theKeys[0];
        if (currentBinder != null) {
            selectedBinder = currentBinder.getKey().toString();
        }
        for (String key : theKeys) {
            if (key.equals(selectedBinder)) {
                bindersEl.select(key, true);
            }
        }
    } else {
        String[] theKeys = new String[] { currentBinder.getKey().toString() };
        String[] theValues = new String[] { currentBinder.getTitle() };
        bindersEl.setKeysAndValues(theKeys, theValues, null);
        bindersEl.setEnabled(false);
        bindersEl.reset();
        bindersEl.select(theKeys[0], true);
    }
}
Also used : Binder(org.olat.modules.portfolio.Binder)

Example 74 with Binder

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

the class SharedPagesController method doSelectedPage.

private Activateable2 doSelectedPage(UserRequest ureq, SharedPageRow row) {
    removeAsListenerAndDispose(pageCtrl);
    Page reloadedPage = portfolioService.getPageByKey(row.getPageKey());
    Binder binder = reloadedPage.getSection().getBinder();
    OLATResourceable pageOres = OresHelper.createOLATResourceableInstance("Entry", reloadedPage.getKey());
    WindowControl swControl = addToHistory(ureq, pageOres, null);
    List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
    BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
    pageCtrl = new PageRunController(ureq, swControl, stackPanel, secCallback, reloadedPage, false);
    listenTo(pageCtrl);
    stackPanel.pushController(reloadedPage.getTitle(), pageCtrl);
    return pageCtrl;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) Binder(org.olat.modules.portfolio.Binder) OLATResourceable(org.olat.core.id.OLATResourceable) PageRunController(org.olat.modules.portfolio.ui.PageRunController) AssessedPage(org.olat.modules.portfolio.model.AssessedPage) Page(org.olat.modules.portfolio.Page) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl)

Example 75 with Binder

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

the class SharedBindersController method doLeaveBinder.

private void doLeaveBinder(SharedItemRow row) {
    Binder binder = portfolioService.getBinderByKey(row.getBinderKey());
    portfolioService.removeAccessRights(binder, getIdentity());
    loadModel(tableEl.getQuickSearchString());
}
Also used : AssessedBinder(org.olat.modules.portfolio.model.AssessedBinder) Binder(org.olat.modules.portfolio.Binder)

Aggregations

Binder (org.olat.modules.portfolio.Binder)144 Section (org.olat.modules.portfolio.Section)72 Identity (org.olat.core.id.Identity)70 Test (org.junit.Test)68 SynchedBinder (org.olat.modules.portfolio.model.SynchedBinder)58 Page (org.olat.modules.portfolio.Page)44 RepositoryEntry (org.olat.repository.RepositoryEntry)34 Assignment (org.olat.modules.portfolio.Assignment)30 ArrayList (java.util.ArrayList)22 SectionRef (org.olat.modules.portfolio.SectionRef)22 AssessedBinder (org.olat.modules.portfolio.model.AssessedBinder)20 AssessmentSection (org.olat.modules.portfolio.AssessmentSection)16 OLATResourceable (org.olat.core.id.OLATResourceable)14 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)14 PortfolioService (org.olat.modules.portfolio.PortfolioService)14 BinderImpl (org.olat.modules.portfolio.model.BinderImpl)14 AccessRights (org.olat.modules.portfolio.model.AccessRights)12 Date (java.util.Date)10 WindowControl (org.olat.core.gui.control.WindowControl)10 AssessmentSectionImpl (org.olat.modules.portfolio.model.AssessmentSectionImpl)8