Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
serverJIRA (slidewiki.atlassian.net)
serverId497b9b88-e2b8-32ee-be05-4d265f33883f
keySWIK-946
.

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
serverJIRA (slidewiki.atlassian.net)
serverId497b9b88-e2b8-32ee-be05-4d265f33883f
keySWIK-945
.

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=

...

propertytyperequired
format
description
operation
id
string
integeryes
one of 'update', 'remove', 'insert'timestampdate stringyesiso date stringuserintegeryes
if no index

the id of the deck

can be omitted only for the last part of the path for specific change types

revisionintegeryes if id presentthe revision of the deck
titlestringnothe title of the deck revision at the time the change took place
indexinteger
if operation is 'remove' or 'insert'beforePropertiesPatchif operation is 'update' and index is not setprovides the patch to be performed to the deck properties to undo the changeafterPropertiesPatchif operation is 'update' and index is not setprovides the patch to be performed to the deck properties to apply the changeinsertContentItemif operation is 'insert'provides the deck/slide reference of the item insertedremoveContentItemif operation is 'remove'provides the deck/slide reference of the item removedupdateContentItemUpdateif operation is 'update' and index is setprovides the undo/redo patches for the update to the contentItem

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=

propertytyperequireddescription
idintegeryesthe id of the deck or slide
revisionintegeryesthe revision of the deck or slide
titlestringnothe tile of the deck or slide at the time the change took place

NodeValue=

propertytyperequireddescription
kindstringyes

either deck or slide

refNodeRefValueyesthe 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=

propertytyperequiredformatdescription
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=

propertytyperequireddescription
beforeContentItemPatchyesprovides the patch to undo the content item change in parent deck change object
afterContentItemPatchyesprovides the patch to apply the content item change in parent deck change object

ContentItemPatch=

same definition as "kind" on the ContentItemmodelsame definition as "ref" on the ContentItemmodel, but only "revision" can be set (no "id")
propertytyperequiredformatdescription
kindref
opstringyesone of 'add', 'remove', 'replace', 'move', or 'update'
timestampdate stringyesiso date string
userintegeryes
patharray of ChangePathPartyescan be empty for the root deck 'update' change
fromarray of ChangePathPartif operation is 'move'provides the previous path of the node moved in the tree
valueNodeValueyes if op is 'add', 'remove', 'replace' or 'move'provides the node value referenced by the change
oldValueNodeValueyes if op is 'replace'

provides the node value replaced when creating a revision for a deck child

valuesUpdateValuesyes if op is 'update'provides the new values for the deck data updated
oldValuesUpdateValuesyes if op is 'update'provides the old values for the deck data updated