Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Section
Column
width50%

ChangeApplier API

This section explains and documents the various Javascript API calls for instantiating and working with ChangeAppliers.

Instantiating a ChangeApplier

Instantiating a ChangeApplier is extremely simple.

Code Block
javascript
javascript
var applier = fluid.makeChangeApplier(model);
Code Block
javascript
javascript
var applier = fluid.makeChangeApplier(model, options);

Please see Options below for more information about the new options parameter. Note that this new parameter is independent of the new Transaction support (which also uses options).

The makeChangeApplier call takes a single argument, which is the model object (the root of a tree of plain Javascript objects) to which this applier is to be attached. Note that by standard model semantics, whilst any subobjects and properties under this tree can and will change asynchronously, the essential identity of this model tree is defined by this exact object handle model. Therefore to establish agreement amongst model citizens and appliers about which model is being talked about, this object handle must be preserved, whatever happens to the object tree beneath it. The Fluid base framework contains various utility functions which help to make this easy - for example

Code Block
javascript
javascript
fluid.clear(model);

is a call which unlinks all properties from the supplied model, preparing it for a wholesale change. A corresponding useful call is

Code Block
javascript
javascript
fluid.model.copyModel(model, newModel)
Column
Panel
borderColor#566b30
bgColor#fff
titleBGColor#D3E3C4
borderStylesolid
titleOn This Page
borderStylesolid
Table of Contents
maxLevel5
minLevel2
Panel
borderColor#321137
bgColor#fff
titleBGColor#c1b7c3
borderStylesolid
titleSee Also
borderStylesolid
Include Page
Still Need Help panel
Still Need Help panel

...