Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions docs/My-Egeria-Doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All source files named here are in `my_egeria/my_egeria/DemoCode/My_Profile/`.
| `tech_types_handler.py`, `TechnologyTypeScreens.py` | `TechTypesMixin` and the technology type screens |
| `team_roles_handler.py`, `MyTeamScreen.py` | `TeamRolesMixin` and the team roster screen |
| `bookmarks_handler.py`, `MyBookMarksScreen.py` | `BookmarksMixin` (bookmarks kept in a personal collection) and the bookmarks screen |
| `network_handler.py`, `MyNetworkScreen.py` | `NetworkMixin` (peers linked by `Peer` relationships), `MyNetworkScreen` and `ConfirmRemovePeerScreen` |
| `UserIdentitiesScreen.py` | Read-only user identity table |
| `StatusScreen.py` | Result message with copy-GUID |
| `profile_utils.py` | Environment check and data clean-up helpers |
Expand Down Expand Up @@ -64,13 +65,21 @@ classDiagram
list_my_bookmarks()
add_my_bookmark() / delete_my_bookmark()
}
class NetworkMixin {
show_my_network()
list_my_peers()
search_people()
link_peer() / unlink_peer()
get_peer_details()
}
App <|-- MyProfileApp
TechTypesMixin <|-- MyProfileApp
ShopForDataMixin <|-- MyProfileApp
TeamRolesMixin <|-- MyProfileApp
ElementsCrudMixin <|-- MyProfileApp
FeedbackMixin <|-- MyProfileApp
BookmarksMixin <|-- MyProfileApp
NetworkMixin <|-- MyProfileApp
```

- **App bindings:**
Expand Down Expand Up @@ -156,6 +165,7 @@ It returns `200` on success and `401` on failure.
| Subscriptions | `ViewSubscriptionsScreen()` |
| Technology Types | `handle_technology_types_option()` |
| User Bookmarks | `show_my_bookmarks()` |
| My Network | `show_my_network()` |
| Leave Feedback | `action_feedback()` |
| Feedback Log | `action_view_feedback_log()` (owner only) |

Expand Down Expand Up @@ -481,6 +491,61 @@ After each change it re-reads the list through the app. The lookup matches on th

---

## My Network

A user's network is the set of people linked to their profile by a `Peer` relationship. `NetworkMixin` (`network_handler.py`) makes the Egeria calls; `MyNetworkScreen` only drives it through `self.app`. Each call builds a fresh `Egeria` client with a bearer token (`_network_client()`) and closes its session afterwards.

```mermaid
sequenceDiagram
autonumber
actor User
participant App as NetworkMixin
participant MNS as MyNetworkScreen
participant Confirm as ConfirmRemovePeerScreen
participant EG as Egeria

User->>App: Other Functions → My Network
App->>EG: get_related_elements(user_GUID, "Peer")
App->>MNS: push(peer rows)
opt view details (v)
MNS->>App: get_peer_details(peer GUID)
App->>EG: get_actor_profile_by_guid(JSON)
App->>App: _generate_my_profile_output(DICT, "My-User")
App-->>MNS: (contact methods, communities)
end
opt add (search, select, Add to Network)
MNS->>App: search_people(name)
App->>EG: find_actor_profiles(DICT, "User-Identities", page_size=10)
App-->>MNS: (name, GUID, qualified name) rows
MNS->>App: link_peer(GUID, nickname, description)
App->>EG: link_peer_person(user_GUID, GUID, PeerProperties)
MNS->>App: list_my_peers()
end
opt remove (d)
MNS->>Confirm: push(peer name)
Confirm-->>MNS: True / False
MNS->>App: unlink_peer(GUID)
App->>EG: unlink_peer_person(user_GUID, GUID)
MNS->>App: list_my_peers()
end
```

| Function | What it does |
| :--- | :--- |
| `show_my_network()` | Refuses (with a notice) if `user_GUID` isn't set yet, i.e. the profile hasn't loaded; otherwise pushes `MyNetworkScreen(list_my_peers())` |
| `list_my_peers()` | `get_related_elements(user_GUID, "Peer")`, keeping only elements whose properties are `PersonProperties`. Returns `(qualified name, display name, full name, pronouns, GUID, description)` rows; the GUID comes from the peer's `elementHeader` and the description from `relationshipProperties`. `[]` when Egeria answers "No elements found", `None` if Egeria can't be reached |
| `search_people(search_string)` | `find_actor_profiles(..., ignore_case=True, report_spec="User-Identities", page_size=10)` → `(display name, GUID, qualified name)` rows, excluding the current user. The screen also drops anyone already in the network |
| `link_peer(guid, nickname, description)` | `link_peer_person(user_GUID, guid, NewRelationshipRequestBody)` with `PeerProperties` (`peer_relationship_name` = nickname, `description`) |
| `unlink_peer(guid)` | `unlink_peer_person(user_GUID, guid, DeleteRelationshipRequestBody)`, using the same GUID order as `link_peer_person` |
| `get_peer_details(guid)` | `get_actor_profile_by_guid(guid, JSON)`, then `_generate_my_profile_output(..., report_spec="My-User")`. Returns the `Contact Methods` and `Communities` lists, or `None` with a notice if there are no details |

- **Removing only unlinks.** The peer's profile is never changed. If the details panel is showing the person just removed, it is hidden.
- **Refresh.** After a successful add or remove the screen re-reads the network with `list_my_peers()`.
- **Errors.** Every Egeria failure is reported with `notify(...)` and the screen stays open; none of them exit the app.
- **Return code.** `MyNetworkScreen` dismisses with `200` on `q`; `my_network_callback` just logs it.

---

## Status Screen

`StatusScreen(message)` shows a read-only message:
Expand All @@ -497,7 +562,8 @@ The app's `status_callback` then returns to the main screen.
| Report spec | Used by |
| :--- | :--- |
| `My-User-MD` | Profile load and reload |
| `User-Identities` | User identity table |
| `User-Identities` | User identity table; My Network people search |
| `My-User` | My Network peer details (contact methods, communities) |
| `My-User-ToDos` | To-dos table |
| `Actor-Profiles` | User GUID fallback |
| `Comment-by-Element` | Comments screen |
Expand All @@ -509,7 +575,7 @@ The app's `status_callback` then returns to the main screen.
| Client | Used for |
| :--- | :--- |
| `MyProfile` | Profile, identities, to-dos, `add_my_profile` |
| `Egeria` | Element create, link and delete; comments from main; bookmarks; feedback note logs; tabular data; `update_actor_profile`; `find_collections` |
| `Egeria` | Element create, link and delete; comments from main; bookmarks; My Network; feedback note logs; tabular data; `update_actor_profile`; `find_collections` |
| `EgeriaTech` | Comments screen |
| `AutomatedCuration` | Technology types |
| `ProductManager` | Digital subscriptions |
Expand Down Expand Up @@ -548,6 +614,8 @@ The suite in `tests/micro-tests/my_profile/` has one module per handler and scre

**Running the whole app in a test.** Tests that run `MyProfileApp.run_test()` stub the profile client with `stub_profile_client()`.

**My Network.** `test_network_handler.py` covers `NetworkMixin` and `MyNetworkScreen`, including the remove confirmation; `test_my_profile_app.py` checks the menu routing. The feature has also been tested by hand against a live server.

**Add screens.** `test_screens.py::TestBaseAddScreen` covers the `BaseAddScreen` flow: required-field checks, create, link or no link, and keeping the form after a failed create.

---
Expand Down
18 changes: 15 additions & 3 deletions docs/my_profile_app_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# My Profile App User Manual

The **My Profile App** is a terminal user interface (TUI), built with [Textual](https://textual.textualize.io/) and the `pyegeria` SDK, that gives an Egeria user a personal dashboard: their profile, roles, teams, communities, blogs, journal, to-dos and user identities, plus access to comments, feedback, data shopping, subscriptions and technology types.
The **My Profile App** is a terminal user interface (TUI), built with [Textual](https://textual.textualize.io/) and the `pyegeria` SDK, that gives an Egeria user a personal dashboard: their profile, roles, teams, communities, blogs, journal, to-dos and user identities, plus access to comments, feedback, data shopping, subscriptions, technology types and their network of peers.

This manual describes how to *use* the app. For how it works internally (screens, handlers, Egeria calls and flow diagrams) see the [My Profile Reference Guide](My-Egeria-Doc.md).

Expand Down Expand Up @@ -218,7 +218,7 @@ Opens a screen with five tables, each loading in the background: **Glossaries**,
- `u` or `ctrl+s` – subscribe to the highlighted item.
- `t` – search glossary terms. Back from the search (`g`) returns to Shop for Data.
- `k` – bookmark the highlighted item; `ctrl+b` – open bookmarks with its GUID ready to add.
- `b` – back; `q` – quit the screen.
- `b` or `Escape` – back to the main screen; `q` – quit the screen.

On the overview screen, `s` subscribes to the selected node, `b` goes back and `q` returns to the main screen. On a sample-data view, `s` subscribes, and `b`, `Escape` or `Enter` go back.

Expand Down Expand Up @@ -250,6 +250,16 @@ On the bookmarks screen:

Your bookmarks are kept in Egeria as the members of your private **My Bookmarks** collection (qualified name `Bookmarks::<your user id>`), and only that collection. It is created the first time you bookmark something, anchored to your profile and linked from it with a `ResourceList` relationship whose resource use is "Bookmarks".

### My Network
Your network is the people linked to your profile in Egeria. The screen lists them (qualified name, display name, full name, pronouns, GUID and the description you gave the link). If your profile has not finished loading, the app tells you to wait and does not open the screen.

- **View details:** highlight a person and press `v` (or **Person Details**). A panel shows their **contact methods** and the **communities** they belong to. A message tells you if either is empty.
- **Add someone:** type all or part of a name in the search field and press `Enter`. Up to 10 matching people are listed, leaving out you and anyone already in your network. Select a person, optionally enter a **nickname** and a **description** of your relationship, then press **Add to Network**. **Cancel** clears the selection.
- **Remove someone:** highlight a person and press `d` (or **Remove from Network**), then confirm with **Remove**. **Cancel** or `Escape` keeps them. Only the link between you is removed; their profile is not changed.
- `q` returns to the main screen.

Each person in your network is linked to your profile with a `Peer` relationship. The nickname and description are stored on that relationship.

### Leave Feedback / Feedback Log
See [Leaving Feedback](#leaving-feedback).

Expand All @@ -267,10 +277,12 @@ See [Leaving Feedback](#leaving-feedback).
| `ctrl+b` | Main screen, Shop for Data | Bookmarks, with the highlighted row's GUID ready to add |
| `ctrl+k` | Main screen | Bookmark the selected row |
| `ctrl+n` / `d` / `q` | Bookmarks | Add by GUID / remove highlighted / close |
| `v` / `d` / `q` | My Network | Show highlighted person's details / remove highlighted person / close |
| `Enter` | My Network search field | Search for people to add |
| `a` / `d` / `Escape` | Edit screens | Add row / delete row / back |
| `ctrl+a` / `q` | Add screens | Add / close (outside a text field) |
| `ctrl+a` / `ctrl+r` / `q` | Comments screen | Add comment / show responses to highlighted comment / close |
| `s` / `u` or `ctrl+s` / `t` / `k` / `b` / `q` | Shop for Data | Sample / subscribe / search glossary terms / bookmark / back / close |
| `s` / `u` or `ctrl+s` / `t` / `k` / `b` or `Escape` / `q` | Shop for Data | Sample / subscribe / search glossary terms / bookmark / back / close |
| `s` / `b` / `q` | Overview | Subscribe / back / back to main |
| `c` / `q` | Create Subscription | Create / cancel |
| `c` / `Enter` / `q` | Status screen | Copy GUID / close / close |
Expand Down
Loading
Loading