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