PROJECT: contactHeRo


Overview

contactHeRo is a desktop contact management application for recruiters across companies who need a quick and efficient way to manage the contact details and profiles of their potential recruits. It is a Command Line Interface(CLI) application with several useful features such as a login system, email system, a view linkedIn profile feature as well as an in-built calendar.

This portfolio is to collate my contributions to this project as well as showing my developments in software engineering skills which I have learned from CS2103T.

Summary of contributions

  • Major enhancement: added the login system in contactHeRo.

    • What it does: provides security for the user’s data.

    • Justification: Recruiters are dealing with data of their potential employees and some of these data are personal and sensitive. Recruiters may also have some confidential company data stored in the application. Hence it is necessary for them to set up some form of security to protect these sensitive data. Having a login system is one of the common methods to ensure data security.

    • Highlights: This enhancement provides a foundation for other security measures to be implemented in contactHeRo in the future to further help users in securing their important data.

    • Credits: stackoverflow.com.

  • Minor enhancement: added the ability to clear history of user input.

    • What it does: It allows the user erase the past commands which was inputted in the command line.

    • Justification: As our app only uses one command line interface for all user input and it comes with a history command which lets the user see the list previously entered commands, this may expose some of the sensitive data which the user has inputted, like login username and password. Hence being able to clear away the history of user inputs can help to protect those sensitive information.

    • Highlights: This was one of my first enhancement to the project and it helped me get familiarise with the logic component of the code.

  • Code contributed: [Functional code] [Test code]

  • Other contributions:

    • Project management:

      • Reach the milestones v1.1 - v1.3rc and v1.5rc - 1.5 on GitHub.

      • Created issues and milestones for the team.

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.

Logging in : login

You can login via the command line using the following format.
Format: login u/USERNAME pw/PASSWORD

Examples:

  • login u/JohnDoe pw/doe123

    On running the above command, you should see the following success message:
    You have successfully logged in as JohnDoe

Logging out : logout

You can logout via the command line using the following this format.
Format: logout

On running this command, you should see the following success message:
You have logged out successfully!

Changing your username : updateusername

You can change your username by using the following format.
Format: updateusername u/NEWUSERNAME

  • Username has to be alphanumeric and is at least 3 characters long.

Examples:

  • updateusername u/JohnDoe

    On running the above command, you should see the following success message:
    You have successfully changed your username to JohnDoe

Changing your password : updatepassword

You can change your password by using the following format.
Format: updatepassword pw/OLDPASSWORD npw/NEWPASSWORD

  • Password should start with a alphanumeric character and is at least 5 characters long.

  • It should contain at least 1 digit, 1 alphabet and not contain any white spaces.

Examples:

  • updatepassword pw/Doe123 npw/doe456

    On running the above command, you should see the following success message:
    You have successfully updated your password!

Managing Persons

This section describes the commands you can use to manage person profiles in contactHeRo.

Adding a person : add

You can add a person to contactHeRo using the following format.

Format: n/NAME p/PHONE e/EMAIL a/ADDRESS cp/CURRENT_POSITION cc/COMPANY [pp/PROFILE_PICTURE_PATH] [s/SKILL]…​

A person can have any number of skills (including 0)
Profile Picture indicates the profile picture’s file path

Examples:

  • add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01 cp/Software Engineer cc/Google

    On running the above command, you should see the following success message:

    New person added: John Doe Phone: 98765432 Email: johnd@example.com Address: John street, block 123, #01-01 Current Position: Software Engineer Company: Google Skills:
  • add n/Betsy Crowe s/Java e/betsycrowe@example.com a/Newgate Prison p/1234567 cp/Student cc/NUS s/C++

    On running the above command, you should see the following success message:

    New person added: Betsy Crowe Phone: 1234567 Email: betsycrowe@example.com Address: Newgate Prison Current Position: Student Company: NUS  Skills: [C++]

Editing a person : edit

You can edit an existing person in contactHeRo using this format.

Format: edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [cp/CURRENT_POSITION] [cc/COMPANY] [pp/PROFILE_PICTURE_PATH][s/SKILL]…​

  • Edits the person at the specified INDEX. Remember that the index refers to the index number shown in the last person listing. The index must be a positive integer 1, 2, 3, …​

  • You need to provide at least one of the optional.

  • Existing values will be updated to the input values.

  • When you edit skills, the existing skills of the person will be removed i.e adding of skills is not cumulative.

  • You can remove all the person’s skills by typing s/ without specifying any skills after it.

Examples:

  • edit 1 p/91234567 e/johndoe@example.com
    Edits the phone number and email address of the 1st person to be 91234567 and johndoe@example.com respectively.

    On running the above command, you should see the following success message:

    Edited Person: John Doe Phone: 91234567 Email: johndoe@example.com Address: John street, block 123, #01-01 Current Position: Software Engineer Company: Google Skills:
  • edit 2 n/Betsy Crower s/
    Edits the name of the 2nd person to be Betsy Crower and clears all existing skills.

    On running the above command, you should see the following success message:

    Edited Person: Betsy Crower Phone: 1234567 Email: betsycrowe@example.com Address: Newgate Prison Current Position: Student Company: NUS Skills:

Listing all persons : list

You can see a list of all persons in contactHeRo using the following format.
Format: list

Locating persons by name or skill : find

You can find all the persons whose names or skills contain any of the given keywords using the following format.
Format: find n/KEYWORD [MORE_NAME_KEYWORDS] to find by name or find s/KEYWORD [MORE_SKILL_KEYWORDS] to find by skill

  • The search is case insensitive. e.g hans will match Hans

  • The order of the keywords does not matter. e.g. Hans Bo will match Bo Hans

  • Only the name or skill is searched, depending on the prefix (n/ or s/)

  • Only full words will be matched e.g. Han will not match Hans

  • Persons matching at least one keyword will be returned (i.e. OR search). e.g. Hans Bo will return Hans Gruber, Bo Yang

Examples:

  • find n/John
    This will show any person having the name john or John.

  • find s/designer
    This will show Jane Doe whose skill is designer.

  • find n/Betsy Tim John
    This will show any person having any of the names Betsy, Tim, or John.

Deleting a person : delete

You can delete a specified person from contactHeRo using the following format.
Format: delete INDEX

  • Deletes the person at the specified INDEX.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • list
    delete 1
    This deletes the 1st person in contactHeRo and on running the above command, you should see the following success message:

    Deleted Person: John Doe Phone: 98765432 Email: johnd@example.com Address: John street, block 123, #01-01 Current Position: Software Engineer Company: Google Skills:
  • find n/Betsy
    delete 1
    This deletes the 1st person in the results of the find command and on running the above command, you should see the following success message:

    Deleted Person: Betsy Crower Phone: 1234567 Email: betsycrowe@example.com Address: Newgate Prison Current Position: Student Company: NUS Skills:

Viewing the contact details of a person: select

You can select a person identified by the index number used in the last person listing to view his/her contact details using the following format.
Format: select INDEX

  • Shows the contact details of the person at the specified INDEX in a formatted page.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • list
    select 2
    This selects the 2nd person in contactHeRo.

  • find n/Betsy
    select 1
    This selects the 1st person in the results of the find command.

    On running this command, you should see a similar result as the following (Refer to figure 5). Betsy is selected in the person list and her contact details are visible in the Contact Details Tab.

selectCommand
Figure 1. Select Command Execution

Searching a person on LinkedIn: linkedIn

You can select a person identified by the index number used in the last person listing to search him/her on LinkedIn using the following format.
Format: linkedIn INDEX

  • This loads the LinkedIn search of the person at the specified INDEX.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

  • You will have to login to LinkedIn the first time to use this command in order to search the person.

We do not save or log any of your LinkedIn credentials or information as we respect your privacy. Therefore, everytime you restart contactHeRo, you will have to login again.

Examples:

  • list
    linkedIn 2
    This loads the LinkedIn search of the 2nd person in the contactHeRo.

  • find n/Betsy
    linkedIn 1
    This loads the LinkedIn search of 1st person in the results of the find command.

    On running the above command and after you have logged in, you should a similar result as the following (Refer to figure 6). Betsy is selected in the person list and she is searched on LinkedIn in the LinkedIn Tab.

linkedInCommand
Figure 2. LinkedIn Command Execution

Managing Job Openings

This section describes the commands you can use to manage jobs in contactHeRo.

Adding a job opening: addjob

You can add a job opening to contactHeRo using the following format.
Format: addjob p/POSITION t/TEAM l/LOCATION n/NUMBER_OF_POSITIONS s/SKILL_REQUIRED…​

Examples:

  • addjob p/Software Engineer t/Cloud Services l/Singapore n/1 s/Java

    On running the above command, you should see the following success message:

    New job opening added: Software Engineer Team: Cloud Services Location: Singapore Number of Positions: 1 Skills: [Java]
  • addjob p/Marketing Intern t/Social Media Marketing l/Kuala Lampur, Malaysia n/1 s/Excel s/Writing

    On running the above command, you should see the following success message and the job opening UI(Refer to figure 7) added to the Job List Panel(Refer to figure 3):

    New job opening added: Marketing Intern Team: Social Media Marketing Location: Kuala Lampur, Malaysia Number of Positions: 1 Skills: [Excel][Writing]
addjobCommand
Figure 3. A job opening in contactHeRo

Editing a job opening : editjob

You can edit an existing job opening in contactHeRo using this format.

Format: editjob INDEX [p/POSITION] [t/TEAM] [l/LOCATION] [n/NUMBER_OF_POSITIONS] [s/SKILL]…​

  • Edits the job opening at the specified INDEX. Remember that the index refers to the index number shown in the last job listing. The index must be a positive integer 1, 2, 3, …​

  • You need to provide at least one of the optional.

  • Existing values will be updated to the input values.

  • When you edit skills, the existing skills of the job opening will be removed i.e adding of job’s skills is not cumulative.

  • Unlike editing a person feature, you cannot remove all the job’s skills by typing s/ because a job opening requires at least one skill.

Examples:

  • editjob 1 p/Hardware Engineer t/Hardware Products
    Edits the position and team of the 1st job opening to be Hardware Engineer and Hardware Products respectively.

    On running the above command, you should see the following success message:

    Edited Job: Hardware Engineer Team: Hardware Products Location: Singapore Number of Positions: 1 Skills: [Java]

Locating job opening by position, location or skill : findjob

You can find all the persons whose names or skills contain any of the given keywords using the following format.
Format:

  • findjob p/KEYWORD [MORE_KEYWORDS] to find by position or

  • findjob s/KEYWORD [MORE_KEYWORDS] to find by skill or

  • findjob l/KEYWORD [MORE_KEYWORDS] to find by location.

Some things to take note of:

  • The search is case insensitive. e.g hans will match Hans

  • The order of the keywords does not matter. e.g. Hans Bo will match Bo Hans

  • Only the name or skill is searched, depending on the prefix (n/ or s/)

  • Only full words will be matched e.g. Han will not match Hans

  • Persons matching at least one keyword will be returned (i.e. OR search). e.g. Hans Bo will return Hans Gruber, Bo Yang

Examples:

  • findjob p/Hardware Engineer
    This will show any job with position Hardware Engineer.

  • findjob s/Java
    This will show any job which requires Java.

  • findjob l/Singapore
    This will show any job in Singapore.

Listing all job openings : listjob

You can see a list of all job openings in contactHeRo using the following format.
Format: listjob

Deleting a job opening: deletejob

You can delete a specified job opening from contactHeRo using the following format.
Format: deletejob INDEX

  • Deletes the job opening at the specified INDEX.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • listjob
    deletejob 2
    This deletes the 2nd job opening in contactHeRo and on running the above command, you should see the following success message:

    Deleted Job: Marketing Intern Team: Social Media Marketing Location: Kuala Lampur, Malaysia Number of Positions: 1 Skills: [Excel][Writing]

Matching a job opening to a person: matchjob

You can see potential candidates for a specified job opening in contactHeRo using the following format.
Format: matchjob INDEX

  • Matches the job opening at the specified INDEX to potential candidates using skill-matching.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • list
    matchjob 1
    This will show any person whose skills match any of those required for the job opening at index 1.

  • findjob s/Software
    matchjob 1
    This will show any person whose skills match any of those required for the job opening at index 1 in the results of the findjob command.

    On running this command, you should see a similar result as the following (Refer to figure 8). All persons having any skill as required by the job 'Software Engineer' will be shown.

matchjobCommand
Figure 4. MatchJob Command Execution

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

dateView
Figure 5. Date view

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

weekView
Figure 6. Week view

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

monthView
Figure 7. Month view

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

yearView
Figure 8. Year view

Managing Emails

This section describes the commands you can use to manage emails in contactHeRo

Login to Google : googlelogin

You will have to login to google in order to use features like emailing. This process is simple and fast like how you would normally login using the web browser.
Format: googlelogin

  • Opens up the Google tab. This is contactHeRo’s built-in browser for Google logins. Simply enter your email and password to login.

  • You will have to login in order to use the Email command to send email.

  • IMPORTANT: Please do not go to other webpage in the Google tab after you have logged in.

    This is because contactHeRo has to use the login information from the webpage after you have login to send your email.

  • NOTE: We do not save or log any of your Google credentials or information as we respect your privacy. Therefore, everytime you restart contactHeRo, you have to login again.

Examples:

  • googlelogin
    This will open up the Google tab for you to login. On running the above command, you should see the following success message:

    Please log in to Google.

    You should also see the login screen as shown below.

googlelogin1
Figure 9. The Google log in page
Please do not go to any other webpages in the Google tab after you have logged in.

Now that you have logged in, you are ready to use the Email feature to send out emails!

Emailing your contact : email

You can send email to any person you have saved in contactHeRo using the following format.
Format: email INDEX [sub/EMAIL_SUBJECT]

  • Opens up the Draft Email tab. This is an User Interface for you to draft your emails.

  • Collects the information of the person at the specified INDEX.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

  • The collected information will be used to help you fill up details in the draft like the person’s email address.

  • The email subject title is optional.

Examples:

  • list
    email 2
    This will open up the Draft Email tab and then collect the information of the 2nd person in the list.

  • list
    email 2 sub/Interview on 13 May 2018
    This will open up the Draft Email tab and then collect the information of the 2nd person in the list. It will also set the email subject title to "Interview on 13 May 2018".

On running the above commands, you should see similar message like the following:

Drafting email to: berniceyu@example.com

The collected information will be used automatically to fill up details as shown below in figure 5. If you have also used sub/Interview on 13 May 2018 in the command, the Subject textbox will also be fill with "Interview on 13 May 2018".

emailSS1
Figure 10. The User Interface to draft your email
You can use keyboard short-cuts like Ctrl-B to bold your text while drafting your email.

Finally, after you are done drafting up the email, simply hit the Send button to send your email. If the email is sent successfully, you should see a pop-up message as shown below.

emailSS2
Figure 11. Pop-up message

Utility Features

This section describes the commands that will help you make better use of contactHeRo. ==== Viewing help : help

In case you get stuck while using contactHeRo and would like to see the User Guide, you can do so by using the following format.
Format: help

This opens the help window as shown below in figure 3.

helpWindow
Figure 12. Help Window in contactHeRo

Listing entered commands : history

Lists all the commands that you have entered in reverse chronological order.
Format: history

Pressing the and arrows will display the previous and next input respectively in the command box.

Clearing list of entered commands : clearhistory

You can clear your history of entered commands using the following format.
Format: clearhistory

On running the above command, you should see the following success message:
Your history has been cleared.

Undoing previous command : undo

You can restore contactHeRo to the state before the previous undoable command(refer to note below) was executed in case you make a mistake or otherwise, using the following format.
Format: undo

Undoable commands: those commands that modify the contactHeRo’s content (add, delete, edit, addjob, deletejob, editjob and clear).

Examples:

  • delete 1
    list
    undo (reverses the delete 1 command)

  • select 1
    list
    undo
    The undo command fails as there are no undoable commands executed previously.

  • delete 1
    clear
    undo (reverses the clear command)
    undo (reverses the delete 1 command)

Redoing the previously undone command : redo

You can reverse the most recent undo command using the following format.
Format: redo

Examples:

  • delete 1
    undo (reverses the delete 1 command)
    redo (reapplies the delete 1 command)

  • delete 1
    redo
    The redo command fails as there are no undo commands executed previously.

  • delete 1
    clear
    undo (reverses the clear command)
    undo (reverses the delete 1 command)
    redo (reapplies the delete 1 command)
    redo (reapplies the clear command)

Clearing all entries : clear

You can clear all your contacts from contactHeRo using the following format.
Format: clear

+ On running the above command, you should see the following success message:
contactHeRo has been cleared!

Exiting the program : exit

You can exit the program using the following format.
Format: exit

Auto-complete command

To save your time, after typing a partial command, you can press TAB for the command to be auto-completed.

The first lexicographically matched command is returned.

Examples:

  • Typing ad and pressing TAB gives:
    add n/ e/ a/ [s/]…​

  • Typing h and pressing TAB gives:
    help

Saving the data

You do not need to save manually. contactHeRo saves the data into the hard disk for you automatically.

Coming in V2.0

Arranging meetings with Gmail calendar [coming in v2.0]

You will soon be able to arrange meeting on Gmail calender using contactHeRo.

Setting reminders [coming in v2.0]

You will soon be able to set reminders for meetings, appointments or any other event and contactHeRo will remind you of the event.

Better matching of jobs [coming in v2.0]

Job matching will soon be improved using Artificial Intelligence methods.

FAQ

Q: How do I transfer my data to another Computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder.

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.

contactHeRo Cheat Sheet

The following sections summarize the commands you can use in contactHeRo.

Managing your contactHeRo account

Function Command Example

Logging in

login

login u/Admin pw/ad123

Changing your username

updateusername u/NEWUSERNAME

updateusername u/JohnDoe

Changing your password

updatepassword pw/PASSWORD npw/NEW_PASSWORD

updatepassword pw/Doe123 npw/doe456

Logging out

logout

logout

Managing Persons

Function Command Example

Adding a person.

add n/NAME p/PHONE e/EMAIL a/ADDRESS cp/CURRENT_POSITION cc/COMPANY [pp/PROFILE_PICTURE_PATH] [s/SKILL]…​

add n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 cp/Software Engineer cc/Google pp//home/trafalgarandre/downloads/john.jpeg s/Java s/C++

Editing an existing person.

edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [cp/CURRENT_POSITION] [cc/COMPANY] [pp/PROFILE_PICTURE_PATH] [s/SKILL]…​

edit 1 p/91234567 e/johndoe@example.com

Deleting an existing person.

delete INDEX

delete 2

Showing a list of all persons.

list

list

Finding persons by name.

find n/KEYWORD [MORE_KEYWORDS]

find n/John

Finding persons by skill.

find s/KEYWORD [MORE_KEYWORDS]

find s/Java

Seeing contact details of a person.

select INDEX

select 3

Searching a person on linkedIn.

linkedIn INDEX

linkedIn 3

Managing Job Openings

Function Command Example

Adding a job opening.

addjob p/POSITION t/TEAM l/LOCATION n/NUMBER OF POSITIONS s/SKILL REQUIRED…​

addjob p/Software Engineer t/Cloud Services l/Singapore n/1 s/Java

Editing an existing job opening.

editjob INDEX [p/POSITION] [t/TEAM] [l/LOCATION] [n/NUMBER_OF_POSITIONS] [s/SKILL]…​

editjob 1 p/Backend Software Engineer t/Backend Services

Deleting an existing job opening.

deletejob INDEX

deletejob 2

Showing a list of all job openings.

listjob

listjob

Finding job openings by position.

findjob p/KEYWORD [MORE_KEYWORDS]

findjob p/Engineer

Finding job openings by location.

findjob l/KEYWORD [MORE_KEYWORDS]

findjob l/Singapore

Finding job openinngs by skill.

findjob s/KEYWORD [MORE_KEYWORDS]

findjob s/Java s/Excel

Matching a job opening to a person.

matchjob INDEX

matchjob 3

Managing Appointments

Function Command Example

Adding an appointment.

addapp t/TITLE sdt/START_DATE_TIME edt/END_DATE_TIME

addapp t/Birthday sdt/2018-03-26 12:00 edt/2018-03-26 12:30

Deleting an existing appoinment.

delapp t/TITLE sdt/START DATE TIME edt/END DATE TIME

delapp t/Birthday sdt/2018-03-26 12:00 edt/2018-03-26 12:30

Viewing the Calendar

Function Command Example

Opening the calendar.

calendar

calendar

Viewing a specific date or switch to the date view.

date

date 2018-04-26

Viewing a specific date and time or switch to the date and time view.

datetime

date 2018-04-26 12:00

Viewing a specific week or switch to the week view.

week [YEAR WEEK]

week 2018 10

Viewing a specific month or switch to the month view.

month [MONTH]

month

Viewing a specific year or switch to the year view.

year [YEAR]

year 2018

Managing Emails

Function Command Example

Login to google

googlelogin

googlelogin

Emailing your contact.

email INDEX [sub/EMAIL_SUBJECT]

email 2 sub/Interview on 13 May 2018

Utility Commands

Function Command Example

Viewing help.

help

help

Listing entered commands.

history

history

Clearing list of entered commands.

clearhistory

clearhistory

Undo previous command.

undo

undo

Redo previous command.

redo

redo

Clear all data.

clear

clear

Exit contactHeRo.

exit

exit

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.

Login System Implementation

Current Implementation

The login system is currently implemented such that there is only one user per application. Logging in and out of contactHeRo is done in the same way as the other commmands which is through the command line.

Logging in

When the user starts the application, the user will see the display screen. The user will need to login in order to switch to the main display to view the data. Most of the commands will be locked so as to prevent modification of the data in contactHeRo before a user logs in. The commands that are available for use are LoginCommand, HelpCommand, ClearHistoryCommand and ExitCommand.

The user will need to enter the login command to log in before he can get to the main window. The image below shows the sequence diagram for the login command in the logic component.

LoginSDLogicComponent
Figure 13. Logic Component Sequence Diagram for logging in

As seen in the image, when the user logs in, an instance of LogicCommand is created which then makes a function call to Model to check the validity of the inputs. Afterwards, the LogicCommand instance will post a LoginEvent to \ EventsCenter and the event will be handled by the UI component to switch the display.

Logging out

When the user is done with using the application, the user can use the LogoutCommand to log out. Once the log out is entered, the user will be brought back to the display screen.

Customizing username and password

Currently, a default username and password is given for first time users of contactHeRo. This information can be seen in the in the ResultDisplayPanel in the display window when the user starts up the application. See the image below.

LoginPrompt
Figure 14. LoginScreen.png

Users can change the username and password by using the updateusername command and updatepassword command respectively.

Constraints are set to both username and password to prevent illegal values from being used, such as an empty string. The code snippets for the regex of both username and password are shown below.
public static final String USERNAME_VALIDATION_REGEX = "\\S\\w{3,20}";
public static final String PASSWORD_VALIDATION_REGEX = "(?=.*[A-Za-z])(?=.*\\d)[\\p{Alnum}](\\S{4,20})";

Storing of user account

In our implementation, the Account class in the model component stores the in-memory data for the username and password. The AccountsManager class handles the methods which interacts with the data in Account, such as login and update password.

For storing of the user account data in hard disk, it is handled by the XmlAccountData class in the storage component. The data will be stored as an XML file in a JAXB-friendly version XmlAdaptedAccount. This data file is a separate file from the file which stores the main data of contactHeRo.

Design Considerations

Aspect: Storing of user account data

Alternative 1 (current choice): Stores user account data in a separate file.+ Pros: User can still retrieve their data if they forget their customize username or password by simply removing the file storing account data and logging in with their default username and password.
Cons: Data is not very secure as everyone can access the data through the default username and password.

Alternative 2: Stores user account data in the same file with the main data.
Pros: Resolves problem of accessing data from default account.
Cons: Data in contactHeRo becomes lost if user forgets the customized username or password.

Aspect: How login UI is implemented

Alternative 1 (current choice): Use the same window for the display screen and main screen.
Pros: Faster to implement as layout is similar to main screen. Also reduces code duplication.
Cons: Can only do small changes to layout for display screen.

Alternative 2: Create a separate login window.
Pros: Login UI can be customized to make it more user friendly for users visually.
Cons: User do not have to deal with the opening and closing of windows which may slow the app.

Matching jobs implementation

Current Implementation

The JobMatchCommand uses PersonSkillContainsKeywordsPredicate to match person’s skills with a job’s skills. It accepts the index for the job to match and then uses the PersonSkillMatchesKeywordsPredicate to match the job. Below is the code for the execution of the JobMatchCommand:

@Override
public CommandResult execute() throws CommandException {
    ...
    Job jobToMatch = lastShownList.get(targetIndex.getZeroBased());

    model.updateFilteredPersonList(new PersonSkillContainsKeywordsPredicate(
            CollectionUtil.getSetAsStringList(jobToMatch.getSkills())));
    // return result
}

PersonSkillMatchesKeywordsPredicate takes in the list of skills of the job as the keywords as the parameter and then checks if the person has any of these skills using the SkillUtil. The code for matching the skills is as follows:

/**
 * Checks if a set of skills contains any of the {@code keywords}.
 */
public static boolean match(List<String> keywords, Set<Skill> list) {
    String skillList = getSkillsAsString(list);
    return keywords.stream()
            .anyMatch(keyword -> StringUtil.containsWordIgnoreCase(skillList, keyword));
}
To minimize code duplication, we made a utility class SkillUtil which is used both by PersonSkillMatchesKeywordsPredicate during execution of matchjob and find s/ commands and JobSkillMatchesKeywordsPredicate during the execution of findjob s/ command.

Proposed Enhancement

  • Add data encryption feature to further improve the security of the data in contactHeRo.

  • Add shortcut keys to scroll through the list of data in contactHeRo to make it more user-friendly.