use of org.olat.course.nodes.dialog.DialogElementsManager in project OpenOLAT by OpenOLAT.
the class DialogCourseNodeIndexer method doIndex.
@Override
public void doIndex(SearchResourceContext repositoryResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter) throws IOException, InterruptedException {
SearchResourceContext courseNodeResourceContext = createSearchResourceContext(repositoryResourceContext, courseNode, null);
Document document = CourseNodeDocument.createDocument(courseNodeResourceContext, courseNode);
indexWriter.addDocument(document);
RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
DialogElementsManager dialogElmsMgr = CoreSpringFactory.getImpl(DialogElementsManager.class);
List<DialogElement> elements = dialogElmsMgr.getDialogElements(entry, courseNode.getIdent());
for (DialogElement element : elements) {
Forum forum = element.getForum();
doIndexAllMessages(courseNodeResourceContext, forum, indexWriter);
doIndexFile(element, courseNodeResourceContext, indexWriter);
}
}
use of org.olat.course.nodes.dialog.DialogElementsManager 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.course.nodes.dialog.DialogElementsManager in project openolat by klemens.
the class DialogCourseNodeIndexer method doIndex.
@Override
public void doIndex(SearchResourceContext repositoryResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter) throws IOException, InterruptedException {
SearchResourceContext courseNodeResourceContext = createSearchResourceContext(repositoryResourceContext, courseNode, null);
Document document = CourseNodeDocument.createDocument(courseNodeResourceContext, courseNode);
indexWriter.addDocument(document);
RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
DialogElementsManager dialogElmsMgr = CoreSpringFactory.getImpl(DialogElementsManager.class);
List<DialogElement> elements = dialogElmsMgr.getDialogElements(entry, courseNode.getIdent());
for (DialogElement element : elements) {
Forum forum = element.getForum();
doIndexAllMessages(courseNodeResourceContext, forum, indexWriter);
doIndexFile(element, courseNodeResourceContext, indexWriter);
}
}
use of org.olat.course.nodes.dialog.DialogElementsManager in project openolat by klemens.
the class DialogCourseNode method cleanupOnDelete.
/**
* life cycle of node data e.g properties stuff should be deleted if node gets
* deleted life cycle: create - delete - migrate
*/
@Override
public void cleanupOnDelete(ICourse course) {
super.cleanupOnDelete(course);
DialogElementsManager depm = CoreSpringFactory.getImpl(DialogElementsManager.class);
RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
List<DialogElement> dialogElements = depm.getDialogElements(entry, getIdent());
for (DialogElement dialogElement : dialogElements) {
Long forumKey = dialogElement.getForum().getKey();
SubscriptionContext subsContext = CourseModule.createSubscriptionContext(course.getCourseEnvironment(), this, forumKey.toString());
NotificationsManager.getInstance().delete(subsContext);
depm.deleteDialogElement(dialogElement);
}
}
use of org.olat.course.nodes.dialog.DialogElementsManager 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);
}
Aggregations