-
Notifications
You must be signed in to change notification settings - Fork 712
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 #279 from jtooya/edit-DG
Edit dg to include information on Import command
- Loading branch information
Showing
8 changed files
with
256 additions
and
41 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,22 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
skinparam ArrowColor blue | ||
group sd Conversion | ||
participant "Converter:CsvToJsonConverter" as Converter STORAGE_COLOR | ||
|
||
[-> Converter:convertAllCsvFiles() | ||
activate Converter | ||
|
||
Converter -> Converter: findAllCsvFiles | ||
|
||
loop until all csv files converted | ||
Converter -> Converter:convertCsvFile | ||
Converter -> Converter:jsonFiles.add(csvFileConvertedtoJson) | ||
end | ||
|
||
Converter -->[ :List<File> jsonFiles | ||
deactivate Converter | ||
end | ||
|
||
@enduml |
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,74 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
skinparam ArrowColor blue | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "i:ImportCommand" as ImportCommand LOGIC_COLOR | ||
participant "r:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
|
||
box STORAGE STORAGE_COLOR_T1 | ||
participant "converter:CsvToJsonConverter" as CsvToJsonConverter STORAGE_COLOR | ||
participant "importer:JsonImporter" as JsonImporter STORAGE_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("import") | ||
|
||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("import") | ||
activate AddressBookParser | ||
|
||
create ImportCommand | ||
AddressBookParser -> ImportCommand : ImportCommand() | ||
activate ImportCommand | ||
|
||
ImportCommand --> AddressBookParser : i | ||
deactivate ImportCommand | ||
|
||
AddressBookParser --> LogicManager : i | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> ImportCommand : execute(model) | ||
activate ImportCommand | ||
|
||
create CsvToJsonConverter | ||
ImportCommand -> CsvToJsonConverter: new CsvToJsonConverter(directory) | ||
activate CsvToJsonConverter | ||
|
||
CsvToJsonConverter --> ImportCommand | ||
deactivate CsvToJsonConverter | ||
|
||
ImportCommand -> CsvToJsonConverter :convertAllCsvFiles() | ||
ref over CsvToJsonConverter : Conversion | ||
CsvToJsonConverter --> ImportCommand: List<File> jsonFiles | ||
|
||
create JsonImporter | ||
ImportCommand -> JsonImporter : new JsonImporter(List<File> jsonFiles) | ||
activate JsonImporter | ||
|
||
JsonImporter --> ImportCommand | ||
deactivate JsonImporter | ||
|
||
ImportCommand -> JsonImporter: importAllJsonFiles(model) | ||
ref over JsonImporter : Importing | ||
JsonImporter --> ImportCommand : newModel | ||
|
||
create CommandResult | ||
ImportCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> ImportCommand : r | ||
deactivate CommandResult | ||
|
||
ImportCommand --> LogicManager : r | ||
deactivate ImportCommand | ||
|
||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |
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,47 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
skinparam ArrowColor blue | ||
group sd Importing | ||
participant ":JsonImporter" as Importer STORAGE_COLOR | ||
participant ":JsonUtil" as Util #grey | ||
participant "j:jsonSerializableAddressBook" as addressBook STORAGE_COLOR | ||
participant "model:Model" as model MODEL_COLOR | ||
|
||
[-> Importer : importAllJsonFiles(model) | ||
activate Importer | ||
|
||
loop Until all json files imported | ||
Importer -> Importer:importJsonFile(jsonFile, model) | ||
activate Importer | ||
Importer -> Util : readJsonFile(filePath, JsonSerializableAddressBook.class) | ||
activate Util | ||
create addressBook | ||
Util --> addressBook | ||
activate addressBook | ||
addressBook ---> Util | ||
deactivate addressBook | ||
Util ---> Importer:j | ||
|
||
|
||
Importer -> addressBook: j.toModelType() | ||
activate addressBook | ||
addressBook --> Importer:jsonAddressBook | ||
deactivate addressBook | ||
Importer -> model : addAllPersons(addressBook) | ||
model --> Importer: newModel | ||
Importer -> Importer: newModel | ||
deactivate Importer | ||
'Hidden arrow to format loop box better. | ||
Importer -[hidden]-> Importer | ||
|
||
|
||
|
||
end | ||
Importer -->[: newModel | ||
deactivate Importer | ||
end | ||
|
||
|
||
|
||
@enduml |
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
Oops, something went wrong.