From the discussion above, I think we agree on two important points:
- we do not want to directly reuse the forum application as a backend for the discussion
- we agree to use xobjects to store the discussion entities (topics, answers…)
Starting from that, I propose the following plan (details below).
First, introducing a 'xwiki-platform-discussion` module containing:
-
xwiki-platform-discussion-store-api
: providing an API to interact with a discussion store
-
xwiki-platform-discussion-store-default
: providing a default implementation for the discussion storage
-
xwiki-platform-discussion-ui
providing
- reusable pieces of UI to display discussions contextually
- a main page to consult the discussions of the current user
Then, we can this new discussion module:
- For the ActivityPub discussions
- As a backend for the forum application
- As a backend for the comments and annotations
- On new interesting places such as in reactions to notifications, or for contextual discussions for a given version of a page
Functional requirements
It should be possible to interact with the discussions of a wiki, from the wiki itself, but also externally (for instance through the ActivityPub protocol).
We need to keep in mind the goal to be able to reuse the discussion module as a backend for various aspects of the wiki so its design must be as generic as possible.
A discussion is represented by a topic containing a list of answers.
The topic can be attached to an entity (a page, a page version, an event…) and has a description. This description can be user-generated content, or be automatically derived from the related entity (for instance the message of a notification), that way even if the attached entity is later removed the context of the discussion is still available.
Discussion Store
The main factor to choose how we store the discussion is whether we can address the problem of xobjects scaling in 13.X (https://jira.xwiki.org/browse/XWIKI-2874).
If we agree to work on xobjects scaling, then a discussion topic and its answers would be:
- if the related entity is a page: directly stored in the page
- if the related entity is not a page: in a hidden page lazily created at the start of the discussion and dedicated to hold a reference to the entity and to store its answers.
If we do not want to make xobjects scale, the principle stays the same, but we will need to created hidden pages for the discussion’s answer too.
Discussion UI
If we want to quickly arrive at a usable result, I suggest keeping a design close to the one of the forum application.
That way, we can hope to be able to reuse design choices made for the forum, and it would also make the reuse of the discussion application as a backend for the forum easier.
It should contain macros to:
- display a preview of a discussion
- display a paginated discussion
- create a discussion
- add an answer to a discussion
- display a global list of all the discussion related to a user
If we agree on this general direction, I’ll update the discussion design draft with a more formal description of what I’ve said above.
WDYT?