Skip to content

Commit

Permalink
Merge branch 'master' into branch-UGv14
Browse files Browse the repository at this point in the history
  • Loading branch information
H4mes authored Apr 15, 2024
2 parents 11baa41 + 91d4b0c commit 93297e8
Show file tree
Hide file tree
Showing 32 changed files with 1,296 additions and 113 deletions.
349 changes: 306 additions & 43 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ Examples:
* `find John` returns `john` and `John Doe`
* `find alex david` returns `Alex Yeoh`, `David Li`

* Before finding:

![Before finding](images/beforeFindLookupPerson.png)

* After finding using `find chester`:

![After finding](images/findPerson.png)

### [3.1.6. Lookup Associated Articles](#3-1-managing-contacts) : `lookup`

Display articles associated with the person where they are contributors or interviewees.
Expand All @@ -288,6 +296,15 @@ Format: `lookup INDEX`
Examples:
* `lookup 1` returns all articles associated with the first person in the list of contacts.

* Before lookup:

![Before lookup](images/beforeFindLookup.png)

* After lookup using `lookup 2`:
* (The articles associated with the second person in the list of contacts are shown)

![After lookup](images/lookupPerson.png)

### [3.1.7. Sorting Persons by Name](#3-1-managing-contacts) : `sort n/`

Sorts persons in ascending order by the lexicographical (alphabetical) ordering of their names.
Expand Down Expand Up @@ -449,7 +466,16 @@ Format: `find -a KEYWORD [MORE_KEYWORDS]`
Examples:
* `find -a Vision Pro` returns articles with headlines containing `Vision` or `Pro`.

* Before finding:

![Before finding](images/beforeFindLookupArticle.png)

* After finding using `find -a iphone`:

![After finding](images/findArticle.png)

### [3.2.6. Filtering Articles](#3-2-managing-articles) : `filter -a`

Filter PressPlanner's database by a combination of attributes to find articles you are looking for quickly.

Format: `filter -a s/STATUS t/TAG ST/START_DATE EN/END_DATE`
Expand Down Expand Up @@ -509,6 +535,15 @@ Format: `lookup -a INDEX`
Examples:
* `lookup -a 1` returns all persons associated with the first article in the list of articles.

* Before lookup:

![Before lookup](images/beforeFindLookup.png)

* After lookup using `lookup -a 2`:
* (Bob who was the contributor for the second article is shown in the list of persons associated with the article

![After lookup](images/lookupArticle.png)

### [3.2.9. Sorting Articles by Date](#3-2-managing-articles) : `sort -a d/`

Sort articles in PressPlanner's database in descending order by their date and time.
Expand Down
27 changes: 15 additions & 12 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
@startuml
!include style.puml
!include style2.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1

box <size:35>Logic</size> LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
box <size:35>Model</size> MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("delete 1")
[-> LogicManager : <size:30>execute("delete 1")</size>
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
LogicManager -> AddressBookParser : <size:30>parseCommand("delete 1")</size>
activate AddressBookParser

create DeleteCommandParser
Expand All @@ -27,29 +28,29 @@ activate DeleteCommandParser
DeleteCommandParser --> AddressBookParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
AddressBookParser -> DeleteCommandParser : <size:30>parse("1")</size>
activate DeleteCommandParser

create DeleteCommand
DeleteCommandParser -> DeleteCommand
activate DeleteCommand

DeleteCommand --> DeleteCommandParser :
DeleteCommand --> DeleteCommandParser
deactivate DeleteCommand

DeleteCommandParser --> AddressBookParser : d
DeleteCommandParser --> AddressBookParser : <size:30></size>
deactivate DeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
destroy DeleteCommandParser

AddressBookParser --> LogicManager : d
AddressBookParser --> LogicManager : <size:30>d</size>
deactivate AddressBookParser

LogicManager -> DeleteCommand : execute(m)
LogicManager -> DeleteCommand : <size:30>execute(m)</size>
activate DeleteCommand

DeleteCommand -> Model : deletePerson(1)
DeleteCommand -> Model : <size:30>deletePerson(1)</size>
activate Model

Model --> DeleteCommand
Expand All @@ -62,8 +63,10 @@ activate CommandResult
CommandResult --> DeleteCommand
deactivate CommandResult

DeleteCommand --> LogicManager : r
DeleteCommand --> LogicManager : <size:30>r</size>
deactivate DeleteCommand
DeleteCommand -[hidden]-> DeleteCommandParser
destroy DeleteCommand

[<--LogicManager
deactivate LogicManager
Expand Down
50 changes: 31 additions & 19 deletions docs/diagrams/FilterSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
@startuml
'https://plantuml.com/sequence-diagram
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":FilterArticleCommandParser" as FilterArticleCommandParser LOGIC_COLOR
participant ":FilterArticleCommand" as FilterArticleCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":ArticleFilter" as ArticleFilter MODEL_COLOR
end box

[-> SetArticleCommandParser : parse
activate SetArticleCommandParser
SetArticleCommandParser -> SetArticleCommand : SetArticleCommand()
activate SetArticleCommand
SetArticleCommand --> SetArticleCommandParser
deactivate SetArticleCommand
[<-- SetArticleCommandParser
deactivate SetArticleCommandParser
[-> SetArticleCommand : executes
activate SetArticleCommand
SetArticleCommand -> Model : getFilter
[-> FilterArticleCommandParser : parse
activate FilterArticleCommandParser

FilterArticleCommandParser -> FilterArticleCommand : FilterArticleCommand()
activate FilterArticleCommand

FilterArticleCommand --> FilterArticleCommandParser
deactivate FilterArticleCommand

[<-- FilterArticleCommandParser
deactivate FilterArticleCommandParser

[-> FilterArticleCommand : executes
activate FilterArticleCommand

FilterArticleCommand -> Model : getFilter
activate Model
Model --> SetArticleCommand
deactivate Model
SetArticleCommand -> ArticleFilter: updateFilter
Model --> FilterArticleCommand
FilterArticleCommand -> ArticleFilter: updateFilter
activate ArticleFilter
ArticleFilter --> SetArticleCommand
ArticleFilter --> FilterArticleCommand
deactivate ArticleFilter
SetArticleCommand -> Model:updateFilteredArticleList
activate Model
FilterArticleCommand -> Model:updateFilteredArticleList
deactivate Model
[<-- SetArticleCommand
[<-- FilterArticleCommand
deactivate
@enduml
17 changes: 17 additions & 0 deletions docs/diagrams/LinkSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml
'https://plantuml.com/sequence-diagram

autonumber

{User} -> ArticleCard : Click
Activate ArticleCard

ArticleCard -> Model : getLink()
Activate Model
Model --> ArticleCard : return link
deactivate Model

ArticleCard -> ArticleCard : openBrowser(link)
[<-- ArticleCard : open webpage
deactivate ArticleCard
@enduml
7 changes: 7 additions & 0 deletions docs/diagrams/LogicClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ package Logic as LogicPackage {
package "Parser Classes" as ParserClasses{
}
Class XYZCommand
Class ABCCommand
CLass "{abstract}\nArticleCommand" as ArticleCommand
Class CommandResult
Class "{abstract}\nCommand" as Command

Expand All @@ -30,18 +32,23 @@ HiddenOutside ..> Logic
LogicManager .right.|> Logic
LogicManager -right->"1" ParserClasses
ParserClasses ..> XYZCommand : <<create>>
ParserClasses ..> ABCCommand : <<create>>

XYZCommand -up-|> Command
ABCCommand -up-|> ArticleCommand
LogicManager .left.> Command : <<call>>
LogicManager .left.> ArticleCommand : <<call>>

LogicManager --> Model
LogicManager --> Storage
Storage --[hidden] Model
Command .[hidden]up.> Storage
Command .right.> Model
note right of XYZCommand: XYZCommand = AddCommand, \nFindCommand, etc
note right of ABCCommand: ABCCommand = AddArticleCommand, \nFindArticleCommand, etc

Logic ..> CommandResult
LogicManager .down.> CommandResult
Command .up.> CommandResult : <<create>>
ArticleCommand .up.> CommandResult : <<create>>
@enduml
62 changes: 62 additions & 0 deletions docs/diagrams/LookupSequenceDiagram-Logic.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":LookupCommandParser" as LookupCommandParser LOGIC_COLOR
participant "s:LookupCommand" as LookupCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box
[-> LogicManager : execute("lookup n/")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("lookup 1")
activate AddressBookParser

create LookupCommandParser
AddressBookParser -> LookupCommandParser : LookupCommandParser()
activate LookupCommandParser

LookupCommandParser --> AddressBookParser
deactivate LookupCommandParser

AddressBookParser -> LookupCommandParser : parse("1")
activate LookupCommandParser

create LookupCommand
LookupCommandParser -> LookupCommand : LookupCommand("1")
activate LookupCommand

LookupCommand --> LookupCommandParser
deactivate LookupCommand

LookupCommandParser --> AddressBookParser : s
deactivate LookupCommandParser
LookupCommandParser -[hidden]-> AddressBookParser : s
destroy LookupCommandParser

AddressBookParser --> LogicManager : s
deactivate AddressBookParser

LogicManager -> LookupCommand : execute()
activate LookupCommand

LookupCommand -> Model : lookupPerson(PersonAtIndex)
activate Model

Model --> LookupCommand
deactivate Model

LookupCommand --> LogicManager : commandResult
deactivate LookupCommand
LookupCommand -[hidden]-> LogicManager : commandResult
destroy LookupCommand

[<--LogicManager : commandResult
deactivate LogicManager
@enduml
32 changes: 32 additions & 0 deletions docs/diagrams/LookupSequenceDiagram-Model.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":ModelManager" as ModelManager MODEL_COLOR
participant ":ArticleWithinPersonPredicate" as ArticleWithinPersonPredicate MODEL_COLOR
end box

[-> Model : lookupPerson(PersonAtIndex)
activate Model

Model -> ModelManager : lookupPerson(PersonAtIndex)
activate ModelManager

create ArticleWithinPersonPredicate
ModelManager -> ArticleWithinPersonPredicate : ArticleWithinPersonPredicate(PersonAtIndex)
activate ArticleWithinPersonPredicate

ArticleWithinPersonPredicate --> ModelManager : ArticleWithinPersonPredicate
deactivate ArticleWithinPersonPredicate

ModelManager -> ModelManager : updateFilteredArticleList(predicate)

ModelManager --> Model :
deactivate ModelManager

[<-- Model :
deactivate Model

@enduml
Loading

0 comments on commit 93297e8

Please sign in to comment.