PROJECT: ForumBook


Overview

ForumBook is a desktop forum application which allows students to exchange information of the courses offered by their school. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in OOP fashion.

Summary of contributions

  • Code contributed: [Functional code]

  • Main feature implemented:: added various commands to enable admin to manage ForumBook

    • What it does: allows admin to better manage ForumBook by providing the following commands:

      • AnnounceCommand: admin is able to create new announcement.

      • CheckAnnouncementCommand: both user and admin are able to check for latest announcement, which is shown in a pop up window.

      • BlockUserFromPostingCommand: admin is able to block a given user.

      • SetAdminCommand: admin is able to set a user as admin or revert an admin to user.

      • CreateModuleCommand: admin is able to create modules.

      • DeleteModuleCommand: admin is able to delete modules.

      • AdminUpdatePasswordCommand: admin is able to update a user’s password.

      • DeleteUserCommand: admin is able to delete a certain user.

    • Justification: This admin management feature improves the product significantly as a new user type, admin, is introduced. These admin commands provide a convenient way for admin to better manage the ForumBook.

    • Highlights: This admin management feature provides a more efficient way for admin to manage ForumBook, admin could easily block a certain user, help a user to update his/her password, etc. It also made ForumBook more user-friendly as it provides a better way of viewing data by showing the login status of the current user in the label at the top right corner, as well as showing the latest announcement in a pop up window.

  • Other contributions:

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Announcing new command : announce

Announce the new announcement created by admin. The first character of announcement title and content must not be a whitespace.
Format: announce aTitle/ANNOUNCEMENT_TITLE aContent/ANNOUNCEMENT_CONTENT

Example:

  • announce aTitle/Urgent! aContent/System maintenance from 4pm to 5pm.

Checking for the latest announcement : checkAnnounce

Check for the latest announcement.
Format: checkAnnounce

Blocking a user from creating thread or comment : blockUser

Block a specific user that match the given argument by admin. User to be blocked must not be an admin. block only takes true or false
Format: blockUser uName/USER_NAME block/BLOCK_OR_UNBLOCK

Example:

  • blockUser uName/john block/true

  • blockUser uName/john block/false

Setting a user as admin or revert an admin to user : setAdmin

Set a user as an admin or revert an admin to user. The user to set as admin must not been blocked. set only takes true or false
Format: setAdmin uName/USER_NAME set/SET_OR_REVERT

Examples:

  • setAdmin uName/john set/true

  • setAdmin uName/john set/false

Creating a new module : createModule

Create a new module by admin. Module code should follow (2 or 3 capital letters) + (4 numbers) + (0 or 1 capital letter) and it should not be blank. E.g. MA1580E, CS2113 or USP1000A, USP1000. Module title should only contain letters and spaces.+ Format: createModule mCode/MODULE_CODE mTitle/MODULE_TITLE

Example:

  • createModule mCode/CS2113 mTitle/Software Engineering and OOP

Updating a module : updateModule

Update an existing module by admin. Note that either one of mCode and mTitle has to be specified
Format: updateModule mId/MODULE_ID [mCode/MODULE_CODE] [mTitle/MODULE_TITLE]

Examples:

  • updateModule mId/3 mCode/CS1221

  • updateModule mId/3 mTitle/Random CS module

  • updateModule mId/3 mCode/CS1221 mTitle/Random CS module

Deleting a module : deleteModule

Delete an existing module by admin.
Format: deleteModule mCode/MODULE_CODE

Example:

  • deleteModule mCode/CS2113

Updating password : updatePass

Update the given user’s password by admin.
Format: updatePass uName/USER_NAME uPass/USER_PASSWORD

Example:

  • updatePass uName/john uPass/098

Delete a user(Admin) : deleteUser

Delete a given user by admin.
Format: deleteUser uName/USER_NAME

Example:

  • deleteUser uName/john

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Admin management

Current Implementation

The admin management is facilitated by various commands. It extends ForumBook with a admin management tool. Additionally, it implements the following operations:

  • AnnounceCommand — Posts new announcement.

  • CheckAnnouncementCommand: Checks for latest announcement.

  • BlockUserFromCreatingCommand: Blocks an existing user from posting either new threads or comments.

  • SetAdminCommand: Sets an existing user as admin or reverts an existing admin to user.

  • CreateModuleCommand: Creates a module by admin.

  • UpdateModuleCommand: Updates an existing module by admin.

  • DeleteModuleCommand: Deletes an existing module by admin.

  • AdminUpdatePasswordCommand: Updates an existing user’s password by admin.

  • DeleteUserCommand: Deletes an existing user by admin.

Given below is an example usage scenario and how the admin management behaves at each step.

Step 1. The admin launches the application, executes announce aTitle/Urgent! aContent/System maintenance from 3PM to 6PM. to add the announcement to storage file. The announce command calls UnitOfWork.getAnnouncementRepository.addAnnouncement(announcement) and then UnitOfWork.commit(), causing a modified forum book state to be saved into ForumBookStorage

SDAnnounce

Step 2. The admin/user executes checkAnnounce to check for the latest announcement in storage file. The checkAnnounce calls the UnitOfWork.getAnnouncementRepository().getLatestAnnouncement() which returns an announcement to be shown in the message dialog.

SDCheckAnnounce

Step 3. The admin executes blockUser uName/john block/true to block john from creating new threads or comments. The block calls User.setIsBlock(true) and then UnitOfWork.commit(), causing another modified forum book state to be saved into ForumBookStorage.

SDBlockUserFromCreating

Step 4. The admin executes setAdmin uName/john set/true to set a certain user as admin or to revert an admin to user. The setAdmin calls the User.setAdmin(true) and then UnitOfWork.commit(), causing another modified forum book state to be saved into ForumBookStorage.

SDSetAdmin

Step 5. The admin executes createModule mCode/CS2113 mTitle/Software Engineering and OOP to create the specific module. The createModule calls the UnitOfWork.getModuleRepository().addModule(module) and then UnitOfWork.commit(), causing another modified forum book state to be save into ForumBookStorage.

SDCreateModule

Step 6. The admin executes updateModule mId/3 mTitle/Software Eng and OOP to update the specific module. The updateModule calls the UnitOfWork.getModuleRepository().updateModule(module) and then UnitOfWork.commit(), causing another modified forum book state to be save into ForumBookStorage.

SDUpdateModule

Step 7. The admin executes deleteModule mCode/CS2113 to delete specific module. The deleteModule calls the UnitOfWork.getModuleRepository().removeModule(module); and then UnitOfWork.commit(), causing another modified forum book state to be save into ForumBookStorage.

SDDeleteModule

Step 8. The admin executes updatePass uName/john uPass/098 to update the user john’s password. The updatePass calls the UnitOfWork.getUserRepository().updateUser(user) and then UnitOfWork.commit(), causing another modified forum book state to be save into ForumBookStorage.

SDUpdatePass

Step 9. The admin executes deleteUser uName/john to delete the user john. The deleteUser calls the ` UnitOfWork.getUserRepository().deleteUser(userToDelete)` and then UnitOfWork.commit(), causing another modified forum book state to be save into ForumBookStorage.

SDDeleteUser
If the syntax of a command is wrong, the program will prompt the user to try again and show a suggested command format.