Search in sources :

Example 6 with ForumFormatter

use of org.olat.modules.fo.archiver.formatters.ForumFormatter 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, ZipOutputStream exportStream, Locale locale) {
    DialogElementsManager depm = CoreSpringFactory.getImpl(DialogElementsManager.class);
    String exportDirName = Formatter.makeStringFilesystemSave(getShortTitle()) + "_" + element.getForum().getKey() + "_" + Formatter.formatDatetimeFilesystemSave(new Date());
    VFSContainer forumContainer = depm.getDialogContainer(element);
    for (VFSItem item : forumContainer.getItems(new VFSLeafFilter())) {
        ZipUtil.addToZip(item, exportDirName, exportStream);
    }
    ForumArchiveManager fam = ForumArchiveManager.getInstance();
    ForumFormatter ff = new ForumStreamedRTFFormatter(exportStream, exportDirName, false, locale);
    fam.applyFormatter(ff, element.getForum().getKey(), null);
}
Also used : ForumFormatter(org.olat.modules.fo.archiver.formatters.ForumFormatter) ForumStreamedRTFFormatter(org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter) ForumArchiveManager(org.olat.modules.fo.archiver.ForumArchiveManager) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) DialogElementsManager(org.olat.course.nodes.dialog.DialogElementsManager) Date(java.util.Date) VFSLeafFilter(org.olat.core.util.vfs.filters.VFSLeafFilter)

Aggregations

VFSContainer (org.olat.core.util.vfs.VFSContainer)6 ForumFormatter (org.olat.modules.fo.archiver.formatters.ForumFormatter)6 Date (java.util.Date)4 LocalFolderImpl (org.olat.core.util.vfs.LocalFolderImpl)4 VFSItem (org.olat.core.util.vfs.VFSItem)4 VFSLeafFilter (org.olat.core.util.vfs.filters.VFSLeafFilter)4 DialogElementsManager (org.olat.course.nodes.dialog.DialogElementsManager)4 ForumArchiveManager (org.olat.modules.fo.archiver.ForumArchiveManager)4 ForumRTFFormatter (org.olat.modules.fo.archiver.formatters.ForumRTFFormatter)4 File (java.io.File)2 FullAccessCallback (org.olat.core.util.vfs.callbacks.FullAccessCallback)2 ForumStreamedRTFFormatter (org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter)2 Property (org.olat.properties.Property)2