Overview
contactHeRo is a contact management solution for recruiters across companies who need a quick and efficient way to manage the profiles of their potential recruits, current job openings and their appointments. It is a Command Line Interface(CLI) application with intuitive usage and effective features.
This project portfolio is to showcase my contribution in the team toward this project. It also illustrates my documentation skills and what I have learned in CS2103T. In the end, I also proposed some potential enhancement based on what I have done.
If you find out any grammar errors or want to clarify anything, please contact me via this email: trafalgarandre@gmail.com. Thank you!
Summary of contributions
This part summarizes my major enhancement, minor enhancement and other contribution in contactHeRo.
-
Major enhancement: added a calendar and the ability to arrange appointments on this calendar.
-
What it does: allows the user to arrange and view appointments effectively on a calendar.
-
Justification: This feature is beneficial to HR managers as they have many appointments. By putting those appointments on contactHeRo, they can easily add and check their appointments without switching tabs.
-
Highlights: This enhancement includes eight new commands, namely,
calendar
,addapp
,delapp
,date
,datetime
,week
,month
andyear
. It requires integrating with a third-party API, namely, CalendarFX and working with all the main components of contactHeRo. -
Credits: calendarFX, stackoverflow.com
-
-
Minor enhancement: added Profile Picture for contacts.
-
What it does: allows the user to add people’s profile picture.
-
Justification: This feature is beneficial to HR managers as they need to contact with many people.
By having profile pictures on contactHeRo, they can easily recognize and memorize people. -
Highlights: This enhancement involves adding attribute
ProfilePicture
toPerson
. This feature helps me to familiarise with the code, especially the connection between model and UI. -
Credits: stackoverflow.com.
-
-
Code contributed: [Functional code] [Test code]
-
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. |
Managing Appointments
This section describes the commands you can use to manage appointments in contactHeRo.
Adding appointment : addapp
You can add appointment using the following format.
Format: addapp t/TITLE sdt/START_DATE_TIME edt/END_DATE_TIME
Examples:
-
addapp t/Meeting sdt/2018-04-05 14:00 edt/2018-04-05 15:00
On running the above command, you should see the following success message:
New appointment added: Meeting Start Date Time: 2018-04-05 14:00 End Date Time: 2018-04-05 15:00
Deleting appointment : delapp
You can delete appointment using the following format.
Format: delapp t/TITLE sdt/START_DATE_TIME edt/END_DATE_TIME
Examples:
-
delapp t/Meeting sdt/2018-04-05 14:00 edt/2018-04-05 15:00
On running the above command, you should see the following success message:
Appointment deleted: Meeting Start Date Time: 2018-04-05 14:00 End Date Time: 2018-04-05 15:00
Viewing the Calendar
This section describes the commands you can use view the calendar in contactHeRo.
Opening the calendar: calendar
You can switch to the calendar tab using the following format.
Format: calendar
Viewing a specific date or switch to the date view: date
You can view a specifc date or switch to the date view by using the following format.
Format: date [DATE]
DATE needs to be in format YYYY-MM-DD
|
-
With
DATE
, you view the specific date
Example:date 2018-04-26
-
Without
DATE
, you change to the date view
Example:date
Viewing a specific date and time or switch to the date and time view : datetime
You can view a specifc date time by using the following format.
Format: datetime [DATE_TIME]
DATE_TIME needs to be in format YYYY-MM-DD HH-mm
|
Example: datetime 2018-04-26 12:00
Viewing a specific week or switch to the week view : week
You can view a specifc week or switch to the week view by using the following format.
Format: week [YEAR WEEK]
Year needs to be in format YYYY.Week needs to be in format WW and WW refers to the order of week in one year.
|
-
With
YEAR WEEK
, you view the specific week
Example:week 2018 10
-
Without
YEAR WEEK
, you change to the week view
Example:week
Viewing a specific month or switch to the month view : month
You can view a specifc month or switch to the month view by using the following format.
Format: month [MONTH]
MONTH needs to be in format YYYY-MM
|
-
With
MONTH
, you view the specific month
Example:month 2018-10
-
Without
MONTH
, you change to the month view
Example:month
Viewing a specific year or switch to the year view : year
You can view a specifc year or switch to the year view by using the following format.
Format: year [YEAR]
YEAR needs to be in format YYYY
|
-
With
YEAR
, you view the specific year
Example:year 2018
-
Without
YEAR
, you change to the year view
Example:year
Q: How do I report bugs to the developers?
A: Please send an email to contactHeRo@gmail.com if you find a bug. Thank you.
To ask more questions, please send your email to contactHeRo@gmail.com.
We are willing to help you.
Conclusion
Once again, thank you for choosing us as your contact management solution! You are our motivation to make this application better.
If you find any bugs or want to propose any ideas, please contact us via contactHeRo@gmail.com.
Hope you enjoy contactHeRo!
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. |
Intro
Welcome to contactHeRo developer guide! This guide contains all the information you need to quickly get started in contributing to contactHeRo.
If you notice any mistakes or if there is any missing vital information then please let us know via contactHeRo@gmail.com.
Let’s get started!
Profile Picture Feature
Profile picture feature allows the user to show persons' profile pictures.
ProfilePicture refers to the class ProfilePicture ."Profile picture" refers to the image file which is used as the profile picture. |
Current implementation
Input and store profile picture path:
ProfilePicture
is a Person
's optional attribute. It receives profile picture path providing by users.
It resides inside model
, but also works with ui
.
ProfilePicture
is updated by either command add
or edit
typed by the user.
As the user will input ProfilePicture
, it is necessary to ensure that the input is valid.
This has been done by two methods:
-
hasValidProfilePicture
: Check if the path is valid and exist. -
isValidProfilePicture
: Check if the path leads to an image file.
These are the two methods:
public static boolean hasValidProfilePicture(String profilePicture) {
File file = new File(profilePicture);
return file.exists() && !file.isDirectory();
}
public static boolean isValidProfilePicture(String test) {
return test.matches(PROFILE_PICTURE_VALIDATION_REGEX);
}
This is the validation regrex for your reference:
public static final String PROFILE_PICTURE_VALIDATION_REGEX = "^$|(.+(\\.(?i)(jpeg|jpg|png|gif|bmp))$)";
Copy and store profile picture:
After the user has input a valid ProfilePicture
, contactHeRo will copy profile picture and store it in a Profile Picture
folder, which resides in the same folder of app.
If this folder doesn’t exist, it will be created when the app is starting. This has been done due to method createProfilePicturesFolder
in StorageManager
.
private void createProfilePicturesFolder() {
File dir = new File("./ProfilePictures");
dir.mkdir();
}
Choosing a name for the copied profile picture so that it will not be duplicate is crucial when copying profile picture.
ContactHeRo deals with this by naming copied profile pictures by the date and time that it was created. Hence, there will not be any duplicates.
This is how it has been done:
private String copyImageToProfilePictureFolder(String profilePicture) {
String destPath = "";
try {
File source = new File(profilePicture);
String fileExtension = extractFileExtension(profilePicture);
Date date = new Date();
destPath = PROFILE_PICTURE_FOLDER.concat(
date.toString().replace(":", "").replace(" ", "").concat(
".").concat(fileExtension));
File dest = new File(destPath);
Files.copy(source.toPath(), dest.toPath());
} catch (IOException e) {
// Exception will not happen as the profile picture path has been check through hasValidProfilePicture
}
return destPath;
}
Show profile picture:
Profile pictures are shown in two places: ContactDetailsDisplay
and PersonCard
(both these views belong to ui
).
Profile Picture
has method getImage
to return profile picture in form of Image
.
Hence, it is shown by calling this method to provide Image
for ImageView
of both views.
If provide picture is not provided, ContactDetailsDisplay
and PersonCard
will show the default profile picture.
This is a code snippet of ContactDetailsDisplay
dealing with profile picture feature:
if (person.getProfilePicture().filePath != null) {
imageView.setImage(person.getProfilePicture().getImage());
} else {
imageView.setImage(getImage(DEFAULT_IMAGE));
}
Don’t know Image and ImageView. Check these two links: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/ImageView.html https://docs.oracle.com/javafx/2/api/javafx/scene/image/Image.html |
Design Considerations
Aspect: How to link profile picture with ProfilePicture
-
Alternative 1 (current choice): Takes in the image path ,copy the image to the ProfilePictureFolder and store the copied image’s path.
-
Pros: We still have profile picture if the original profile picture is lost.
-
Cons: Memory consumption.
-
-
Alternative 2: Store the image path and retrieve the image from the path when necessary.
-
Pros: Less memory consumption.
-
Cons: Original Image may be lost.
-
Managing profile picture
-
Adding a profile picture.
-
Prerequisites: Having a profile picture path, a non image file path and a non existing profile picture path. Let’s call them
profile_picture_path
,invalid_profile_picture_path
andnon_exist_profile_picture_path
. -
Test case:
add n/Tester p/98765432 e/tester@example.com a/NUS cp/Developer cc/Google pp/profile_picture_path
.
Expected: contact Tester is added with the profile picture corresponding toprofile_picture_path
. -
Test case:
add n/Tester2 p/98765432 e/tester@example.com a/NUS cp/Developer cc/Google
.
Expected: contact Tester2 is added with default profile picture. -
Test case:
add n/Tester3 p/98765432 e/tester@example.com a/NUS pp/invalid_profile_picture_path
.
Expected: No person is added. Error details shown in the status message. Status bar remains the same. -
Test case:
add n/Tester3 p/98765432 e/tester@example.com a/NUS pp/non_exist_profile_picture_path
.
Expected: No person is added. Error details shown in the status message. Status bar remains the same.
-
-
Edit a profile picture.
-
Prerequisites: same as above and at list one person in list.
-
Test case:
edit 1 pp/profile_picture_path
.
Expected: profile picture of contact with index 1 change to the profile picture corresponding toprofile_picture_path
. -
Test case:
edit 1 pp/
.
Expected: profile picture of contact with index 1 change to default profile picture. -
Test case:
edit 1 pp/invalid_profile_picture_path
. Expected: Person 1 is not edited. Error details shown in the status message. Status bar remains the same. -
Test case:
edit 1 pp/non_exist_profile_picture_path
. Expected: Person 1 is not edited. Error details shown in the status message. Status bar remains the same.
-
Managing appointments
-
Adding/deleting an appointment.
-
Prerequisites: appointment with
t/Discussion sdt/2018-05-26 12:00 edt/2018-05-26 12:30
has not been added. Test in the order below. -
Test case:
addapp t/Discussion sdt/2018-05-26 12:00 edt/2018-05-26 12:30
Expected: appointment is added. -
Test case:
addapp t/Discussion sdt/2018-05-26 12:00 edt/2018-05-26 12:30
Expected: no addition appointment is added. Error details shown in the status message. Status bar remains the same. -
Test case:
delapp t/Discussion sdt/2018-05-26 12:00 edt/2018-05-26 12:30
Expected: appointment is deleted. -
Test case:
delapp t/Discussion sdt/2018-05-26 12:00 edt/2018-05-26 12:30
Expected: no appointment is delete. Error details shown in the status message. Status bar remains the same. -
Test case:
addapp t/Discussion sdt/2018-05-26 12:00 edt/2018-05-25 12:30
Expected: appointment is not added. Error details shown in the status message. Status bar remains the same.
-
-
Viewing calendar.
-
Prerequisites: test test case 1 before others.
-
Test case:
calendar
.
Expected: calendar panel is opened. -
Test case:
date
orweek
ormonth
oryear
.
Expected: corresponding view is shown. -
Test case:
datetime 2018/03/26 12:00
ordate 2018/03/26
orweek 2018 10
ormonth 2018/03
oryear 2018
. Expected: corresponding view at specific time is shown. -
Test case:
datetime 2018/02/29 12:00
.
Expected: no things change except error details shown in the status message.
-
has potentials for further development such as integrating with Google Calendar.It required working with all the main components of contactHeRo and a third-party API.
Potential Enhancements
Interactive UI for Calendar
Currently, the Calendar can only be viewed by typing command. The challenge with making an Interactive UI for Calendar is to deal with all events of the original interactive UI of CalendarFX. By solving this challenge, the user can change views, choose dates, add and delete appointments by clicking on the Calendar Tab. Hence, interaction with Calendar will be more dynamic and effective.
Syncing with Google Calendar
Keeping appointment offline is not always effective as people do not bring their laptop with them everywhere. Hence, by syncing with Google Calendar, appointments which have been added online via Google Calendar can be copied to contactHeRo effectively. Moreover, appointments added in contactHeRo can also be copied to Google Calendar.