/**
* @see org.olat.core.util.tree.Visitor#visit(org.olat.core.util.nodes.INode)
*/
public void visit(INode node) {
MessageNode mn = (MessageNode) node;
if (isTopThread) {
if(filePerThread){
//make a file per thread
//to have a meaningful filename we create the file here
String filName = "Thread_" + mn.getKey().toString();
tempContainer = makeTempVFSContainer();
this.vfsFil=tempContainer.resolve(filName + ".rtf");
if(vfsFil==null){
tempContainer.createChildLeaf(filName + ".rtf");
this.vfsFil=tempContainer.resolve(filName + ".rtf");
}
}
//important!
isTopThread = false;
}
// Message Title
sb.append("{\\pard \\brdrb\\brdrs\\brdrw10 \\f1\\fs30\\b ");
sb.append(getImageRTF(mn));
sb.append(getTitlePrefix(mn));
sb.append(mn.getTitle());
sb.append("\\par}");
// Message Body
sb.append("{\\pard \\f0");
sb.append(convertHTMLMarkupToRTF(mn.getBody()));
sb.append("\\par}");
// Message key
sb.append("{\\pard \\f0\\fs15 Message key: ");
sb.append(mn.getKey());
sb.append("} \\line ");
sb.append("{\\pard \\f0\\fs15 created: ");
// Creator and creation date
sb.append(mn.getCreator().getUser().getProperty(UserConstants.FIRSTNAME, null));
sb.append(", ");
sb.append(mn.getCreator().getUser().getProperty(UserConstants.LASTNAME, null));
sb.append(" ");
sb.append(mn.getCreationDate().toString());
// Modifier and modified date
Identity modifier = mn.getModifier();
if (modifier != null) {
sb.append(" \\line modified: ");
sb.append(modifier.getUser().getProperty(UserConstants.FIRSTNAME, null));
sb.append(", ");
sb.append(modifier.getUser().getProperty(UserConstants.LASTNAME, null));
sb.append(" ");
sb.append(mn.getModifiedDate().toString());
}
sb.append(" \\par}");
// attachment(s)
OlatRootFolderImpl msgContainer = fm.getMessageContainer((Long)(getMetainfo(ForumFormatter.MANDATORY_METAINFO_KEY)), mn.getKey());
List attachments = msgContainer.getItems();
if (attachments != null && attachments.size() > 0){
VFSItem item = container.resolve("attachments");
if (item == null){
item = container.createChildContainer("attachments");