/** * It is assumed that if the caller of this method is allowed to see the forum thread starting * from topMessageId, then he also has the right to archive it, so no need for a ForumCallback. * * @param forumFormatter * @param forumId * @param topMessageId * @return the message thread as String formatted */ public String applyFormatterForOneThread( final ForumFormatter forumFormatter, final long forumId, final long topMessageId) { Tracing.logInfo( "Archiving forum.thread: " + forumId + "." + topMessageId, ForumArchiveManager.class); final Map metaInfo = new HashMap(); metaInfo.put(ForumFormatter.MANDATORY_METAINFO_KEY, new Long(forumId)); final MessageNode topMessageNode = convertToThreadTree(topMessageId); return formatThread(topMessageNode, forumFormatter, metaInfo); }
/** * If the forumCallback is null no restriction applies to the forum archiver. (that is it can * archive all threads no matter the status) * * @param forumFormatter * @param forumId * @param forumCallback * @return */ public String applyFormatter( final ForumFormatter forumFormatter, final long forumId, final ForumCallback forumCallback) { Tracing.logInfo("Archiving complete forum: " + forumId, ForumArchiveManager.class); final Map metaInfo = new HashMap(); metaInfo.put(ForumFormatter.MANDATORY_METAINFO_KEY, new Long(forumId)); // convert forum structure to trees final List threadTreesList = convertToThreadTrees(forumId, forumCallback); // format forum trees by using the formatter given by the callee return formatForum(threadTreesList, forumFormatter, metaInfo); }