forked from nus-cs2103-AY1718S2/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from karenfrilya97/projPortfolio
Add project portfolio
- Loading branch information
Showing
32 changed files
with
634 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
64
src/main/java/seedu/address/logic/commands/ImportCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/seedu/address/logic/parser/ImportCommandParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.