Overview
NUS Hangs is a desktop Schedule Manager application. It has a GUI but most of the user interactions happen using a CLI (Command Line Interface). It is a Java application written by developers of F11-4, to target small/mid-size interest/sttudy groups in NUS.
Summary of contributions
-
Major enhancement:
-
created a timetable class in person and did features:
-
add_timetable : adds a timetable csv file to a person.
-
delete_timetable : delete timetable in person and replace it with a default timetable, delete timetable csv file in the person stored folder if there is 1.
-
download_timetable : download timetable as a csv file to a folder
-
edit_timetable : edit the timetable details of a person.
-
-
Justification: This feature improves the product significantly because a user can know his contacts schedule, and can share his timetable easily with others.
-
Highlights: This enhancement affects existing commands and commands to be added in future. The implementation too was challenging as it required changes to existing commands and knowledge of how to get data from csv file in java.
-
Credits:
-
commons-io from apache.commons.io
-
opencsv from com.opencsv
-
jsoup from org.jsoup
-
grokonez from https://grokonez.com/java/java-read-write-csv-file-opencsv-example
-
Laurence Gonsalves from https://stackoverflow.com/questions/923863/converting-a-string-to-hexadecimal-in-java
-
Marcus Junius Brutus from https://stackoverflow.com/questions/1402005/how-to-check-if-internet-connection-is-present-in-java
-
-
-
Minor enhancement: allow timetable to be viewed without internet.
-
Code contributed: [Functional and Test code]
-
Other contributions:
-
Project management:
-
Managed releases
v1.1
-v1.4
(4 releases) on GitHub
-
-
Enhancements to existing features:
-
Documentation:
-
Edit the Developer Guide to include implementation of timetable: #121
-
-
Community:
-
{you can add/remove categories in the list above}
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. |
Timetable(Wen Kai)
Adding a timetable: add_timetable
Short form/Alias: at
User to download timetable template first before using download_timetable INDEX and change csv at the location.
Reload page by clicking on another person and then click on the person again
Or right click on timetable and select the reload page option(Not working).
Format: add_timetable INDEX [fl/FILE_LOCATION]
Example (user does not provide a file path):
-
add_timetable 1
-
add_timetable will add timetable from the given csv file from the person specified by the
INDEX
from file location if file location is present. If not, NUSHangs will throw an error message if the file cannot be found from the given (typed) file path -
Will not be able to add if timetable is not present in the stored location of person specified by
INDEX
Example (user provides a file path):
-
add_timetable 1 fl/C:\Users\timetable\timetable.csv
-
WINDOWS:
-
add_timetable fl/C:\Users\timetable\timetable.csv
(absolute pathing) -
add_timetable fl/timetable.csv
(relative pathing: when the csv file is in the same directory as the jar file).
-
-
MAC:
-
add_timetable 1 fl//FILEPATH
(absolute pathing: note the double slashes) -
add_timetable 1 fl/timetable.csv
(relative pathing).
-
-
add_timetable will add timetable from the given csv file.
-
the first row and first column should be left alone.
-
the top left corner entry can be edited (the blank space at the top of Monday in the first column).
-
can only edit in given rows and columns of the timetable.
-
any invalid timetable will be ignored.
-
example of correctly formatted timetable is given below
Editing a timetable: edit_timetable
Short form/Alias: et
Edits a timetable timeslot of the timetable from the person specified by the INDEX
.
Format: edit_timetable INDEX day/DAY timing/TIMING [m/DETAILS]
Example:
-
edit_timetable 1 day/wednesday timing/0900 m/do cs2103
Example(User clear event at timeslot):
-
edit_timetable 1 day/wednesday timing/0900
Download timetable : download_timetable
Short form/Alias: dlt
Download a timetable from the person specified by the INDEX
to the stored folder from the person specified by the INDEX
as a csv file.
Format: `download_timetable INDEX `
Examples:
-
download_timetable 1
Deleting a timetable : delete_timetable
Short form/Alias: dt
delete csv file of the timetable from stored location from the person specified by the INDEX
and adds a default timetable to the person specified by the INDEX
.Resets the timetable of the person to the default timetable if there is no timetable in the stored location from the person specified by the INDEX
.
Format: delete_timetable INDEX
Examples:
-
list_timetable
delete_timetable 2
Deletes the 2nd timetable in NUS Hangs. -
find Betsy
delete_timetable 1
Deletes the 1st timetable in the results of thefind
command.
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. |
Timetable Feature
As shown in the diagram below, timetable and person classes are associated. A person contains 1 timetable.
Reason for implementation
The objective of the add_timetable
feature is to to add data entries of a timetable into NUS Hangs. But it is hard to visualise the adding of the entries so we allowed user to add directly all the entries from a csv file. For edit_timetable
, it is for User who just want to edit entries without going to find the timetable. For download_timetable
, it is to allow the user to share their timetable to their friends.
How to implement
For add_timetable
, we create a timetable
class in person
first, then we create a timetableData
class with method to create a String [][] Matrix from the data from the csv file. Then we create a timetableString to which contains information on the entries about the timetable
and store it in the xml file of the person in the addressbook.
Current Implementation
The current timetable
commands are:
-
add_timetable
— adds a timetable from the csv file to the person. -
delete_timetable
— delete a timetable from the person and creates a default timetable in person. It will also find the timetable csv file of the person and deletes it. -
edit_timetable
— edit a timetable timeslot in the person -
download_timetable
— downloads a timetable into a csv file into a stored folder location from the person.
These operations are handled by the logic
component and uses the person
in model
to do the execution.
Given below is an activity diagram.
Given below is an example usage scenario and how the add_timetable
behaves at each step.
Step 1: The user launches the application for the first time. The NUS Hangs will initialise the person with the timetable with the details which was stored using Storage.
Step 2: user finds a timetable of first person
in the stored location which is called test7.csv. Using this command, User does not need to type in the timetable name. As shown in the diagram below its easy to see what event the person has.
Step 3: The user executes add_timetable 1
to add the timetable of first person
in stored folder to NUS hangs. A new timetable
will be created containing the data of the timetable
of first person
in stored folder. The timetable
of first person
will be replaced by this new timetable
.
The timetable
is then added to storage as a String which contains all of the data. This is to allow the app to save time in storage.
The following sequence diagram shows how add_timetable
works.
Design Considerations
-
Alternative 1 : adds the timetable via a csv file.
-
Pros: Easier for user to visualise and edit his timetable
-
Cons: Hard to implement. No choice other than to edit his timetable from the stored folder defined.
-
-
Alternative 2 (current choice) : adds the timetable via a csv file from other locations.
-
Pros: Easier for user to visualise and edit his timetable and allows user a choice on where to edit his timetable.
-
Cons: Hard to implement, and user has to know how to get file location of a file.
-
-
Alternative 3: adds the timetable edit by editing the xml file of the person.
-
Pros: Easier to implement
-
Cons: User must know how to edit via the xml file of the person, and harder for User to visualise.
-
Aspect: Data structure to support the add_timetable commands
-
Alternative 1 (current choice): Use a String [][] Matrix to store entries of the timetable.
-
Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project. Better intuition to access entries of the matrix (matrix[i][j]) Which makes
edit_timetable
easier to implement. -
Cons: Slower Time efficiency because using 2 for loops to fill the Matrix with the data. Unable to use functions in ArrayList.
-
-
Alternative 2: Use ArrayList<ArrayList<String>>
-
Pros: Faster Time efficiency because using 1 for loops to fill the Matrix with the data. Able to use functions in ArrayList
-
Cons: Harder for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project. Less intuition to access entries of the matrix (matrix.get(i).get(j)).
-
{Optionally, you may include other projects in your portfolio.}