...
As part of the deck model we define a model for storing the changes applied to the deck after each save or other action on the UI that results to a deck change, with or without creating a new revision. See also
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
The change log is defined as an array considered to be a list of change log records that include at least the a timestamp and the id of the user performing the deck change. This array is stored in the changeLog
attribute inside a deck revision subdocument in mongo db.As we support nested decks, a user is essentially editing a deck tree at any given point, so a change set for a deck tree should also be provided by the deck service API. They include the full path of the deck tree were the edit was performed, and are stored in a separate collection, deckchanges
in mongodb. Each record may be returned via the deck service changes API as part of the change log for any of the decks that are part of the deck tree.
In this document we describe how all the relevant change log records are stored in the mongo db on the deck level. Providing a the mongodb. The API that handles querying the underlying data in order to provide the change log for a deck tree will be analogous to the model described here and is the object of
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Model
We extend the deck revision model to additionally hold a changeLog
attribute which is an array of Deck Change elements.
Deck ChangeEach deckchange record includes a representation for the path of the deck tree were the change was performed. For constructing this path, we use references to decks and indexes for positioning the deck in its parent deck. We also keep the title as optional data in those references, to be used primarily in the UI.
ChangePathPart=
...
property | type | required |
---|
description |
---|
id |
integer | yes |
if no index | the id of the deck can be omitted only for the last part of the path for specific change types | ||
revision | integer | yes if id present | the revision of the deck |
title | string | no | the title of the deck revision at the time the change took place |
index | integer |
The following object includes a subset of deck properties definitions, which includes all the deck properties that are user-defined and editable. Any of the properties are optional in this model but at least one should be defined.
yes if no id | the (zero-based) index of the deck in the content items array of its parent can be omitted only for the first part of the path (the path root) |
To reference nodes in the deck tree we use a simple construct to denote the type of node and its id and revision:
NodeRefValue=
property | type | required | description |
---|---|---|---|
id | integer | yes | the id of the deck or slide |
revision | integer | yes | the revision of the deck or slide |
title | string | no | the tile of the deck or slide at the time the change took place |
NodeValue=
property | type | required | description |
---|---|---|---|
kind | string | yes | either deck or slide |
ref | NodeRefValue | yes | the reference to the deck or slide |
In order to describe the specific changes to the deck metadata we maintain a set of specific keys and value types:
UpdateValues=
property | type | required | format | description |
---|---|---|---|---|
title | no | same definition as "title" on the deck revision model | ||
language | no | same definition as "language" on the deck revision model | ||
theme | no | same definition as "theme" on the deck revision model | ||
license | no | same definition as "license" on the deck model | ||
description | no | same definition as "description" on the deck model |
ContentItemUpdateDeckChange=
property | type | required | description |
---|---|---|---|
before | ContentItemPatch | yes | provides the patch to undo the content item change in parent deck change object |
after | ContentItemPatch | yes | provides the patch to apply the content item change in parent deck change object |
ContentItemPatch=
property | type | required | format | description |
---|---|---|---|---|
kind | same definition as "kind" on the ContentItemmodelref | same definition as "ref" on the ContentItemmodel, but only "revision" can be set (no "id")|||
op | string | yes | one of 'add', 'remove', 'replace', 'move', or 'update' | |
timestamp | date string | yes | iso date string | |
user | integer | yes | ||
path | array of ChangePathPart | yes | can be empty for the root deck 'update' change | |
from | array of ChangePathPart | if operation is 'move' | provides the previous path of the node moved in the tree | |
value | NodeValue | yes if op is 'add', 'remove', 'replace' or 'move' | provides the node value referenced by the change | |
oldValue | NodeValue | yes if op is 'replace' | provides the node value replaced when creating a revision for a deck child | |
values | UpdateValues | yes if op is 'update' | provides the new values for the deck data updated | |
oldValues | UpdateValues | yes if op is 'update' | provides the old values for the deck data updated |