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

Version 1 Next »

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.

The change log is defined as an array of change log records that include at least the timestamp and 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. In this document we describe how all the relevant change log records are stored in the mongo db on the deck level. Providing a change log for a deck tree will be analogous to the model described here and is the object of  SWIK-945 - Getting issue details... STATUS .

Model

We extend the deck revision model to additionally hold a changeLog attribute which is an array of Deck Change elements.

Deck Change=

propertytyperequiredformatdescription
operationstringyesone of 'update', 'remove', 'insert'
timestampdate stringyesiso date string
userintegeryes

indexintegerif operation is 'remove' or 'insert'

beforePropertiesPatchif operation is 'update' and index is not set
provides the patch to be performed to the deck properties to undo the change
afterPropertiesPatchif operation is 'update' and index is not set
provides the patch to be performed to the deck properties to apply the change
insertContentItemif operation is 'insert'
provides the deck/slide reference of the item inserted
removeContentItemif operation is 'remove'
provides the deck/slide reference of the item removed
updateContentItemUpdateif operation is 'update' and index is set
provides 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.

PropertiesPatch=

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


ContentItemUpdate=

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=

propertytyperequiredformatdescription
kind


same definition as "kind" on the ContentItem model
ref


same definition as "ref" on the ContentItem model, but only "revision" can be set (no "id")



  • No labels