use of org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter in project OpenOLAT by OpenOLAT.
the class ForumNodeForumCallback method archiveNodeData.
@Override
public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String charset) {
CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
Property forumKeyProperty = cpm.findCourseNodeProperty(this, null, null, FORUM_KEY);
if (forumKeyProperty == null) {
return false;
}
Long forumKey = forumKeyProperty.getLongValue();
if (ForumManager.getInstance().countThreadsByForumID(forumKey) <= 0) {
return false;
}
String forumName = "forum_" + Formatter.makeStringFilesystemSave(getShortTitle()) + "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
ForumStreamedRTFFormatter rtff = new ForumStreamedRTFFormatter(exportStream, forumName, false, locale);
ForumArchiveManager.getInstance().applyFormatter(rtff, forumKey, null);
return true;
}
use of org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter 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, 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);
}
use of org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter 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);
}
use of org.olat.modules.fo.archiver.formatters.ForumStreamedRTFFormatter in project openolat by klemens.
the class ForumNodeForumCallback method archiveNodeData.
@Override
public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String charset) {
CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
Property forumKeyProperty = cpm.findCourseNodeProperty(this, null, null, FORUM_KEY);
if (forumKeyProperty == null) {
return false;
}
Long forumKey = forumKeyProperty.getLongValue();
if (ForumManager.getInstance().countThreadsByForumID(forumKey) <= 0) {
return false;
}
String forumName = "forum_" + Formatter.makeStringFilesystemSave(getShortTitle()) + "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
ForumStreamedRTFFormatter rtff = new ForumStreamedRTFFormatter(exportStream, forumName, false, locale);
ForumArchiveManager.getInstance().applyFormatter(rtff, forumKey, null);
return true;
}
Aggregations