ForumService Specification
From MacroDeckDevWiki
This is a draft document. It may change at any time.
ForumService will offer all of the internals needed to make functional forums with MacroDeck. A forum should contain posts, and a category contains forums. The top-level element will be the bulletin board, which contains categories.
Contents |
Local Features
- Post creation/editing/deleting
- Forum creation/editing/deleting
- Category creation/editing/deleting
- Board creation/editing/deleting
- Watch lists. A user can flag a forum/post and then receive notifications when new posts occur. This will have to be two parts -- the actual list of stuff being watched and the notification portion.
- Move. Posts should be able to be moved into different forums, and forums into different categories.
- The user's level within a group is honored.
- Private boards (mod/admin and admin-only)
- Password protected boards.
Remote Features
- Post creation/editing/deleting (access controlled)
- Forum creation/editing/deleting (access controlled)
- Category creation/editing/deleting (access controlled)
- Board creation/editing/deleting (access controlled)
- Limited HTML support in post editor (Rails now includes a decent filter -- so we can probably use something like FCKeditor).
Widget-Specific Features
- Post creation/editing/deleting (access controlled)
- Forum creation/editing/deleting (access controlled)
- Category creation/editing/deleting (access controlled)
- Board creation/editing/deleting (access controlled)
Application-Specific Features
This service is designed for widgets, though it could be used by applications outside of MacroDeck.
Synchronizable Data
- Posts
- Forums (and their posts)
- Categories (and their forums, and the posts in those forums)
- Boards (and their categories and their forums and their posts)
- Metadata
Interaction With Other Services
- UserService will be used for access control
- UserService will be used for profiles (unless a ProfileService is created)
- DataService will be used for storing posts.
- Posts and their replies will be one data group, with their parent being the forum (also a data group), whose parent will be the category (also a data group), whose parent will be the board (a data group). The only data items you'll actually have will be for posts/replies. Well, sort of. Each forum will have an associated data_item that is NOT a post (the data type will be different than a post to distinguish this), but contains flags and metadata for the forum.
Technical Data
UUIDs
No UUIDs are currently defined.
APIs
No APIs are currently defined.
Front End
The front end of this service should be a controller. It should be accessed at /group/name/forums (the board index), /group/name/forum/<uuid>/{show|edit|delete|post}/{anything extra here}, and possibly the equavilent for /user. It's not currently decided whether we should give every user a board (it seems like overkill).
There will be a visual cue of the status of a post (read / unread / sticky / locked / participated in).
Post Flags
Flags are boolean values, and there will be several that need to be implemented:
-
is_abuse- Will be settruewhen a user picks "Report Abuse". -
is_sticky- Will be settruewhen a post is made "sticky" in a forum. Only moderators and above can do this (there are three levels in a group: member, moderator, administrator). This flag makes the post show up on the top of the list of posts. -
is_locked- Will be settruewhen a post is made "locked" in a forum. Only moderators and above can do this. This flag makes it so normal users cannot post replies.
There should be functions that can perform the following actions:
- Set/unset a flag on a post.
- Get the status of a flag on a post.
- Get all of the posts in a forum with a particular flag (take into account that more flags will be added later)
- Get all of the posts on a board with a particular flag
Forum Flags
Again, flags are boolean values, and here are those that need to be implemented:
-
is_private- Whentrue, only moderators and administrators can see the forum and participate in discussions inside it. All other users are forbidden from seeing it and seeing its contents. -
is_admin_only- Likeis_private, but only administrators see the board and participate in discussions inside it. -
is_password_protected- All users can join if they enter the correct password. Store the password hashed (SHA512). -
is_news- A flag that makes a forum a news forum. For group news and such. Purely cosmetic.
This will be kept in the metadata DataItem for the forum (see "Interaction With Other Services").
DataItem/DataGroup Hierarchy
- DataGroup for board
- DataGroup for category
- DataGroup for forum
- Forum Metadata DataItem (DTYPE_FORUM_META or something like that)
- DataGroups for posts
- DataItems for messages under a post (keep in mind that the initial message will need to be a DataItem too. We'll sort by creation, so the initial message will always show up on top, and replies will be in the correct order.Threading will not necessarily be implemented.
- DataGroup for forum
- DataGroup for category

