Announcements for changes in a Lepiter knowledgebase
This page describes the announcements used within Lepiter to signal various changes in a knowledgebase and keep the model of the database in sync with the UI.
Announcements for content changes
These are announcements for when the structure or content of a page changes.
There are two types of such announcements:
- announcements for executed commands: are announced when a command is executed
- announcements for direct page changes: are announced by domain objects like pages and snippets when a change happens at that level
Announcements for executed commands
Changes to the content of a page are done in Lepiter using commands. An instance of LeContentCommandExecutedAnnouncement
is announced after a command is executed.
To get more details about what changed one needs to look at the command from within the announcement. Some commands can perform multiple changes to snippets (like merging or splitting snippets), while other command can just rearange the structure of snippets (like indenting a snippet). In all cases, regadless of how many changes the command does only an
Announcements for direct page changes
These can either be for changes in the content of a snipper, or changes in the structure of a page.
Announcements for snippet changes
The main announcement for signalling a change within an individual snippet is LeSnippetContentChanged
. Snippets can use subclasses to model different types of changes.
Depending on the snippet, a single change done within the UI by the user can result in multiple change announcements. To get an idea of what announcement a snippet uses you can check the methods overriding LeSingleSnippetUpdateExamples>>#assertModificationAnnouncements:
in classes testing a specific type of snippet.
Announcements for page structure changes
Subclasses of LeContentTreeChanged
indicate a change in the strucutre of a page.
LeContentTreeAdded
is announcer when a new snippet was added. In case the snippet has children, the announcement is only announced once for the main snippet added to the page.
LeContentTreeRemoved
is announcer when a snippet was removed from a page. In case the snippet has children, the announcement is only announced once for the main snippet removed from the page.
Subclasses of LeContentTreeMoved
are announced for changes that move existing snippets within a page, like moving snippets up and down, or indenting/dedenting snippets.
Announcement for page changes at the page level
These are announcements raised at the level of the page.
LePageTitleChanged
is announcer when the title of named page is changed.
LePageRemovedFromDatabase
is announced when a page is completely removed (as opposed to being moved to another database).
LePageDatabaseChanged
is announcer when a page was moved between two databases.
Announcement for page changes at the knowledgebase level
These are announcements at the level of an entire page.
LeDatabasePageAdded
indicates that a new page was added to a knowledgebase. When an entire knowledgebase is added to a logical knowledgebase, no events for individual pages are raised.
LeDatabasePageRemoved
indicates that a page was explicitly removed from a knowledgebase.
This event is not raised when an entire database is removed, only when users remove individual pages. When an entire database is removed unloading announcements are used.
This event, in combination with a LeDatabasePageAdded
is announced when a page is moved between two databases.
Announcements for unloading databases
LeDatabaseUnloadAnnouncement
indicate that an entire database was unloaded from the system. This means that the database is still on disk, but no longer loaded in GT. When a database is unloaded LePageUnloadAnnouncement
announcements are announcer for every page, and LeSnippetUnloadAnnouncement
for every snippet.