Skip to content

Commit

Permalink
Merge pull request #163 from karenfrilya97/projPortfolio
Browse files Browse the repository at this point in the history
Add project portfolio
  • Loading branch information
Kyomian authored Apr 11, 2018
2 parents 9218cf7 + 104d0f9 commit e8b2370
Show file tree
Hide file tree
Showing 32 changed files with 634 additions and 57 deletions.
10 changes: 5 additions & 5 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ This section describes various design considerations related to the implementati

{empty} +

// tag::storage[]
=== Storage for Task and Event

This section describes the implementation and design considerations for the storage of Task and Event.
Expand Down Expand Up @@ -843,6 +844,7 @@ specialized. The inconvenience of creating 2 separate lists will be counterbalan
the long run.
{empty} +
{empty} +
// end::storage[]

=== Logging

Expand Down Expand Up @@ -1377,6 +1379,8 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un

|`* * *` |student |view completed tasks |be assured I have completed a task

|`* * *` |student |import entries from another file |easily add entries previously saved in another file

|`* * *` |forgetful student |view overdue tasks |be assured I did not miss any deadline

|`* * *` |forgetful student |get notification for upcoming tasks |never forget to complete my tasks
Expand All @@ -1395,10 +1399,7 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un

|`* *` |procrastinating student |add estimated time needed to complete a task |estimate when to start on a task to complete it on time

|`* *` |procrastinating student |view contact details of activity in-charge for a deadline extension |have enough time to complete my assignments despite my tight schedule
=======
|`* *` |procrastinating student |view contact details of person in-charge for a deadline extension |have enough time to complete my task despite my tight schedule
|`* *` |procrastinating student |view contact details of person in-charge for a deadline extension |have enough time to complete my assignments despite my tight schedule

|`* *` |busy student |view free time slots before a deadline |know how much time I have when I'm actually free to finish my tasks

Expand All @@ -1411,7 +1412,6 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un
|`*` |student |be rewarded for completing a task |feel a sense of achievement

|`*` |student |hide private events |minimize chance of someone else seeing them by accident
|=======================================================================

[appendix]
== Use Cases
Expand Down
51 changes: 32 additions & 19 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ Removes a task or event from the desk board according to the following condition
* `rm task INDEX`: removes a task.
* `rm event INDEX`: removes an event.

*Examples:*

*Example:*

* `ls task` +
`rm task 2` +
Expand Down Expand Up @@ -266,7 +265,19 @@ Clears all entries from the desk board.

*Format:* `clear` or `c`

=== Exiting the program : `exit` `[Coming Soon in v1.5]`
// tag::import[]
=== Importing data : `import` `[As of v1.4.1]`

Import all entries from another desk board file in the specified file path.

*Format:* `import f/FILE_PATH`

*Example:*

* `import f/C:\data\deskboard.xml`
// end::import[]

=== Exiting the program : `exit` `[As of v1.4.1]`

Exits the program.

Expand All @@ -291,23 +302,22 @@ There is no need to save manually.
== Command Summary

* *Add task*: `task n/NAME d/DUE_DATE_TIME [r/REMARK] [t/TAGS]` +
eg. `task n/Software Engineering Milestone 1 d/16/03/2018 17:00 r/urgent`
e.g. `task n/Software Engineering Milestone 1 d/16/03/2018 17:00 r/urgent`

* *Add event*: `event n/NAME s/START_TIME e/END_TIME [l/LOCATION] [r/REMARK]` +
eg. `event n/Software Project s/1/5/2018 8:00 e/01/08/2018 8:00 l/School of Computing r/remember to bring laptop charger`
e.g. `event n/Software Project s/1/5/2018 8:00 e/01/08/2018 8:00 l/School of Computing r/remember to bring laptop charger`

* *List uncompleted tasks and upcoming events*: `ls` +
eg. `ls` or `ls task` or `ls event`
* *List uncompleted tasks and upcoming events*: `list` or `ls` +
e.g. `list` or `ls` or `list task` or `ls event`

* *Remove task or event*: `rm` +
eg. `rm task 1` or `rm event 2`
e.g. `rm task 1` or `rm event 2`

* *Complete a task*: `complete task` or `com task` +
eg. `complete task 1` or `com task 2`
e.g. `complete task 1` or `com task 2`

* *List completed tasks*: `ls complete task` or `ls com task` +
eg. `ls complete task` or `ls com task`

e.g. `ls complete task` or `ls com task`

* *Find task and/or event with name contains given keyword*: `find` or `find task` or `find event` +
eg. `find CS2101` or `find event exam` or `find task CS2103`
Expand All @@ -316,25 +326,28 @@ eg. `find CS2101` or `find event exam` or `find task CS2103`
eg. `overdue`

* *List entered commands*: `history` +
eg. `history`
e.g. `history`

* *Undo previous command*: `undo` or `u` +
eg. `undo` or `u`
e.g. `undo` or `u`

* *Redo previously undone command*: `redo` or `r` +
eg. `redo` or `r`
e.g. `redo` or `r`

* *Clear all entries*: `clear` or `c` +
eg. `clear` or `c`
e.g. `clear` or `c`

* *Import data*: `import f\FILE_PATH` +
e.g. `import f/C:\data\deskboard.xml`

* *Exit the program*: `exit` +
eg. `exit`
e.g. `exit`

* *Edit a task*: `edit task` +
eg. `edit task 1`
e.g. `edit task 1`

* *Locate a task by name*: `find task` +
eg. `find task CS2106 Assignment`
e.g. `find task CS2106 Assignment`

* *List all past events*: `ls past event` +
eg. `ls past event`
e.g. `ls past event`
54 changes: 54 additions & 0 deletions docs/team/karenfrilya97.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
= Karen Frilya Celine - Project Portfolio
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: CLIndar

---

== Overview

CLIndar is a desktop application for managing schedules catered specially to university computing students. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

== Summary of contributions

* *Major enhancement*: added *the ability to import data from an xml file.*
** What it does: allows the user to add all entries from application data previously saved in an xml file.
** Justification: This feature improves the product significantly because it spares users the trouble of adding each entry one by one from data previously saved in a different file. This file could have been transferred from another computer.
** Highlights: This enhancement requires new classes to be created that are different from existing classes. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing classes.
** Credits: This enhancement makes uses and enhances existing code for reading data from an xml file written by previous developers.

* *Minor enhancement*: added an autosorting feature that allows the entries to be sorted by date/time every time a new entry is added.

* *Code contributed*: [https://github.com/CS2103JAN2018-W13-B3/main/blob/master/collated/functional/karenfrilya97.md[Functional code]] [https://github.com/CS2103JAN2018-W13-B3/main/blob/master/collated/test/karenfrilya97.md[Test code]]

* *Other contributions*:

** Project management:
*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
** Enhancements to existing features:
*** Refactored the Storage component for the purpose of morphing Address Book - Level 4 into CLIndar (Pull requests https://github.com/CS2103JAN2018-W13-B3/main/pull/40[#40], https://github.com/CS2103JAN2018-W13-B3/main/pull/53[#53],
https://github.com/CS2103JAN2018-W13-B3/main/pull/64[#64], https://github.com/CS2103JAN2018-W13-B3/main/pull/93[#93])
** Documentation:
*** Edited the grammar and punctuation of the Developer Guide in general: https://github.com/CS2103JAN2018-W13-B3/main/pull/152[#152]
*** Restructured Section 4 (Implementation) of the Developer Guide: https://github.com/CS2103JAN2018-W13-B3/main/pull/152[#152]
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com/CS2103JAN2018-W13-B3/main/pull/52[#52]
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com/CS2103JAN2018-F14-B2/main/issues/175[#175], https://github.com/CS2103JAN2018-F14-B2/main/issues/181[#181], https://github.com/CS2103JAN2018-F14-B2/main/issues/182[#182])

== 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._
|===

include::../UserGuide.adoc[tag=import]

== 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._
|===

include::../DeveloperGuide.adoc[tag=storage]
64 changes: 64 additions & 0 deletions src/main/java/seedu/address/logic/commands/ImportCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_FILE_PATH;

import java.io.IOException;

import seedu.address.commons.exceptions.DataConversionException;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.FilePath;
import seedu.address.model.ReadOnlyDeskBoard;
import seedu.address.storage.XmlDeskBoardStorage;

//@@author karenfrilya97
/**
* Imports desk board data from a given xml file.
*/
public class ImportCommand extends UndoableCommand {

public static final String COMMAND_WORD = "import";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Imports desk board data from a given xml file. "
+ "Parameters: "
+ PREFIX_FILE_PATH + "FILE PATH\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_FILE_PATH + "C:\\Users\\Karen\\IdeaProjects\\main\\data\\deskboard.xml";

public static final String MESSAGE_SUCCESS = "Data imported from: %1$s";
public static final String MESSAGE_FILE_NOT_FOUND = "Desk board file %s not found";
public static final String MESSAGE_ILLEGAL_VALUES_IN_FILE = "Illegal values found in file: %s";

private final FilePath filePath;

/**
* Creates an ImportCommand to import data from the specified {@code filePath}.
*/
public ImportCommand(FilePath filePath) {
requireNonNull(filePath);
this.filePath = filePath;
}

@Override
public CommandResult executeUndoableCommand() throws CommandException {
requireNonNull(model);
try {
ReadOnlyDeskBoard toImport = new XmlDeskBoardStorage(filePath.value).readDeskBoard()
.orElseThrow(() -> new CommandException(String.format(MESSAGE_FILE_NOT_FOUND, filePath)));

model.addActivities(toImport);
return new CommandResult(String.format(MESSAGE_SUCCESS, filePath));
} catch (IOException ioe) {
throw new CommandException(String.format(MESSAGE_FILE_NOT_FOUND, filePath));
} catch (DataConversionException dce) {
throw new CommandException(String.format(MESSAGE_ILLEGAL_VALUES_IN_FILE, dce.getMessage()));
}
}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof ImportCommand // instanceof handles nulls
&& filePath.equals(((ImportCommand) other).filePath));
}
}
1 change: 1 addition & 0 deletions src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class CliSyntax {
/* Prefix definitions */
public static final Prefix PREFIX_NAME = new Prefix("n/");
public static final Prefix PREFIX_DATE_TIME = new Prefix("d/");
public static final Prefix PREFIX_FILE_PATH = new Prefix("f/");
public static final Prefix PREFIX_REMARK = new Prefix("r/");
public static final Prefix PREFIX_TAG = new Prefix("t/");
public static final Prefix PREFIX_START_DATETIME = new Prefix("s/");
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/logic/parser/DeskBoardParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import seedu.address.logic.commands.FindCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.HistoryCommand;
import seedu.address.logic.commands.ImportCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.OverdueCommand;
import seedu.address.logic.commands.RedoCommand;
Expand Down Expand Up @@ -104,6 +105,10 @@ public Command parseCommand(String userInput) throws ParseException {
case RedoCommand.COMMAND_WORD:
return new RedoCommand();

//@@author karenfrilya97
case ImportCommand.COMMAND_WORD:
return new ImportCommandParser().parse(arguments);

default:
throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
}
Expand Down
50 changes: 50 additions & 0 deletions src/main/java/seedu/address/logic/parser/ImportCommandParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package seedu.address.logic.parser;

import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_FILE_PATH;

import java.util.stream.Stream;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.logic.commands.ImportCommand;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.FilePath;

//@@author karenfrilya97
/**
* Parses input arguments and creates a new ImportCommand object
*/
public class ImportCommandParser implements Parser<ImportCommand> {

/**
* Parses the given {@code String} of arguments in the context of the ImportCommand
* and returns an ImportCommand object for execution.
* @throws ParseException if the user input does not conform the expected format.
*/

public ImportCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_FILE_PATH);

if (!arePrefixesPresent(argMultimap, PREFIX_FILE_PATH)
|| !argMultimap.getPreamble().isEmpty()) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, ImportCommand.MESSAGE_USAGE));
}

try {
FilePath filePath = ParserUtil.parseFilePath(argMultimap.getValue(PREFIX_FILE_PATH)).get();
return new ImportCommand(filePath);
} catch (IllegalValueException ive) {
throw new ParseException(ive.getMessage(), ive);
}
}

/**
* Returns true if none of the prefixes contains empty {@code Optional} values in the given
* {@code ArgumentMultimap}.
*/
private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) {
return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
}

}
25 changes: 25 additions & 0 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import seedu.address.commons.core.index.Index;
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.commons.util.StringUtil;
import seedu.address.model.FilePath;
import seedu.address.model.activity.DateTime;
import seedu.address.model.activity.Location;
import seedu.address.model.activity.Name;
Expand Down Expand Up @@ -170,4 +171,28 @@ public static Set<Tag> parseTags(Collection<String> tags) throws IllegalValueExc
return tagSet;
}

//@@author karenfrilya97
/**
* Parses a {@code String filePath} into a {@code FilePath}.
* Leading and trailing whitespaces will be trimmed.
*
* @throws IllegalValueException if the given {@code filePath} is invalid.
*/
public static FilePath parseFilePath(String filePath) throws IllegalValueException {
requireNonNull(filePath);
String trimmedFilePath = filePath.trim();
if (!FilePath.isValidFilePath(trimmedFilePath)) {
throw new IllegalValueException(FilePath.MESSAGE_FILE_PATH_CONSTRAINTS);
}
return new FilePath(trimmedFilePath);
}

/**
* Parses an {@code Optional<String> filePath} into an {@code Optional<FilePath>} if {@code filePath} is present.
* See header comment of this class regarding the use of {@code Optional} parameters.
*/
public static Optional<FilePath> parseFilePath(Optional<String> filePath) throws IllegalValueException {
requireNonNull(filePath);
return filePath.isPresent() ? Optional.of(parseFilePath(filePath.get())) : Optional.empty();
}
}
Loading

0 comments on commit e8b2370

Please sign in to comment.