Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Responsible: Kostis Pristouris

Background

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  SWIK-946 - Getting issue details... STATUS .

The change log is considered to be a list of change log records that include a timestamp and the id of the user performing the deck change. 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 mongodb. The API that handles querying the underlying data in order to provide the change log for a deck tree is the object of  SWIK-945 - Getting issue details... STATUS .

Model

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

propertytyperequireddescription
idintegeryes 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
indexintegeryes 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


DeckChange=

propertytyperequireddescription
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



  • No labels