use of org.olat.core.util.vfs.callbacks.FullAccessCallback in project OpenOLAT by OpenOLAT.
the class DialogCourseNode method doArchiveElement.
/**
* Archive a single dialog element with files and forum
* @param element
* @param exportDirectory
*/
public void doArchiveElement(DialogElement element, File exportDirectory, Locale locale) {
DialogElementsManager depm = CoreSpringFactory.getImpl(DialogElementsManager.class);
VFSContainer dialogContainer = depm.getDialogContainer(element);
// there is only one file (leave) in the top forum container
VFSItem dialogFile = dialogContainer.getItems(new VFSLeafFilter()).get(0);
VFSContainer exportContainer = new LocalFolderImpl(exportDirectory);
// append export timestamp to avoid overwriting previous export
String exportDirName = Formatter.makeStringFilesystemSave(getShortTitle()) + "_" + element.getForum().getKey() + "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
VFSContainer diaNodeElemExportContainer = exportContainer.createChildContainer(exportDirName);
// don't check quota
diaNodeElemExportContainer.setLocalSecurityCallback(new FullAccessCallback());
diaNodeElemExportContainer.copyFrom(dialogFile);
ForumArchiveManager fam = ForumArchiveManager.getInstance();
ForumFormatter ff = new ForumRTFFormatter(diaNodeElemExportContainer, false, locale);
fam.applyFormatter(ff, element.getForum().getKey(), null);
}
use of org.olat.core.util.vfs.callbacks.FullAccessCallback in project openolat by klemens.
the class DialogCourseNode method doArchiveElement.
/**
* Archive a single dialog element with files and forum
* @param element
* @param exportDirectory
*/
public void doArchiveElement(DialogElement element, File exportDirectory, Locale locale) {
DialogElementsManager depm = CoreSpringFactory.getImpl(DialogElementsManager.class);
VFSContainer dialogContainer = depm.getDialogContainer(element);
// there is only one file (leave) in the top forum container
VFSItem dialogFile = dialogContainer.getItems(new VFSLeafFilter()).get(0);
VFSContainer exportContainer = new LocalFolderImpl(exportDirectory);
// append export timestamp to avoid overwriting previous export
String exportDirName = Formatter.makeStringFilesystemSave(getShortTitle()) + "_" + element.getForum().getKey() + "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
VFSContainer diaNodeElemExportContainer = exportContainer.createChildContainer(exportDirName);
// don't check quota
diaNodeElemExportContainer.setLocalSecurityCallback(new FullAccessCallback());
diaNodeElemExportContainer.copyFrom(dialogFile);
ForumArchiveManager fam = ForumArchiveManager.getInstance();
ForumFormatter ff = new ForumRTFFormatter(diaNodeElemExportContainer, false, locale);
fam.applyFormatter(ff, element.getForum().getKey(), null);
}
use of org.olat.core.util.vfs.callbacks.FullAccessCallback in project OpenOLAT by OpenOLAT.
the class DocumentPoolMainController method doSelectTemplatesDirectory.
private DocumentDirectoryController doSelectTemplatesDirectory(UserRequest ureq, TaxonomyTreeNode node) {
content.popUpToRootController(ureq);
VFSContainer directory = node.getDirectory();
VFSSecurityCallback secCallback = isTaxonomyAdmin ? new FullAccessCallback() : new ReadOnlyCallback();
directory.setLocalSecurityCallback(secCallback);
String name = translate("document.pool.templates");
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Templates", 0l);
WindowControl bwControl = addToHistory(ureq, ores, null);
DocumentDirectoryController directoryCtrl = new DocumentDirectoryController(ureq, bwControl, directory, name);
directoryCtrl.setAdditionalResourceURL("[Templates:0]");
listenTo(directoryCtrl);
content.pushController(name, directoryCtrl);
return directoryCtrl;
}
use of org.olat.core.util.vfs.callbacks.FullAccessCallback in project openolat by klemens.
the class DocumentPoolMainController method doSelectTemplatesDirectory.
private DocumentDirectoryController doSelectTemplatesDirectory(UserRequest ureq, TaxonomyTreeNode node) {
content.popUpToRootController(ureq);
VFSContainer directory = node.getDirectory();
VFSSecurityCallback secCallback = isTaxonomyAdmin ? new FullAccessCallback() : new ReadOnlyCallback();
directory.setLocalSecurityCallback(secCallback);
String name = translate("document.pool.templates");
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Templates", 0l);
WindowControl bwControl = addToHistory(ureq, ores, null);
DocumentDirectoryController directoryCtrl = new DocumentDirectoryController(ureq, bwControl, directory, name);
directoryCtrl.setAdditionalResourceURL("[Templates:0]");
listenTo(directoryCtrl);
content.pushController(name, directoryCtrl);
return directoryCtrl;
}
Aggregations