I'm sure someone else is doing this too, but I haven't found anything in
my searches so far.
Sometimes you need an easy way to have a discussion forum. Possibilities
with xwiki are:
1) Blog (document per posting)
2) Email (external data store for postings)
3) Separate bulletin board software e.g. phpBB2
4) Object per posting, for example the XWiki Comment class.
2) and 3) don't integrate easily with XWiki; there would be issues with
Search and links to User pages.
1) Creating a document per entry is fine for a limited number of large,
flexibly formatted blog entries. But in a discussion group we want to
support a large number of consistently formatted entries.
So I choose (4).
Looking at the Comment class, it looks adequate for a forum. It has
fields for "Highlighted Text" which would be used for the Subject of
each posting, and "Reply To" which looks like it was intended perhaps
for supporting a threaded discussion!
Before I go off writing a full-featured forum in XWiki, please let me
know if you have done this already or are working on it, or if you have
any recommendations. I've included below my velocity code so far for a
working forum message index (derived from comments.vm).
--
Trevor Cox
skahasoftware.com
Vancouver, Canada
1 Forum: $doc.fullName
## We'll format the comments ourselves
#set($showcomments = "no")
#set($comments = $doc.getComments(false))
#if($comments.size()>0)
#set($count=0)
<table class="wiki-table" width="90%" cellpadding="0"
cellspacing="0"><tr>
<th>Subject</th><th width="100">Posted By</th><th
width="150">Date</th>
</tr>
#foreach($comment in $comments)
<tr>
#set($count=$count+1)
#set($date = $doc.display("date","view",$comment))
#set($commentlen =
$doc.getRenderedContent($doc.display("comment","view",$comment)).length())
#if($commentlen > 40)
#set($commentlen = 40)
#end
<td>
$doc.getRenderedContent($doc.display("comment","view",$comment)).substring(0,$commentlen)
... </td>
<td>
$!xwiki.getLocalUserName($doc.display('author','view',$comment))
</td>
<td> $!date </td>
</tr>
#end
</table>
#end
<div id="xwikiaddcomment">
#if($context.hasAccessLevel("comment", $doc.fullName)==false)
$msg.get("nocommentswithoutright")
#else
#set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
#set($comment = $cclass.newObject())
<form action="$doc.getURL("commentadd")"
method="post">
<p>
<input type="hidden" name="xredirect"
value="${doc.getURL("view")}" />
<br />
<input type="hidden" name="XWiki.XWikiComments_author"
value="$context.user" />
<input type="hidden" name="XWiki.XWikiComments_date"
value="" />
<br />
#set($pclass = $comment.getxWikiClass().get("comment"))
$doc.displayEdit($pclass,"XWiki.XWikiComments_",$comment)
<br />
<input type="submit" value="Post Reply" />
</p>
</form>
#end
</div>