Skip to content
tiry edited this page Apr 16, 2012 · 4 revisions

Context

The definition of the "New EasySOA Model" implies to manage tree versionning inside Nuxeo Content Repository.

Here are just some initial notes about what needs to be done.

Some notes about the default "Leaf versioning" model

By default, Nuxeo Content Repository does only manage version of document without versionning its hierachy.

This mean, a Folder can ber versionned, but the version will not contain any reference to the children and anyway the children won't be versionned (no recursive versionning).

This type of feature (tree versioning) has already been implemented on several projects, but each time implementation was very specific to the target use cases.

Proposed Approach

The proposed approach is to implement this features as an Addon and once the model is correct and fulfills all requirements, it may be pushed at low level inside VCS if it does make sense.

The goal is to avoid having to run EasySOA against a branch to be able to test the feature.

Requirements

Recursive versioning and configuration object

To version a folder, we need to :

  • recursively version all children that are checked out
  • store the snapshot of the versions
  • create a version of the folder
  • associate the snapshot to the version of the folder

The snapshot is basically a tree structure that contains the parent=> children links on the versioned objects

Proxies and publishing

In order to reuse Nuxeo Publishing features and to rely on the standard security policy, we want to be able to publish a Folder.

This means :

  • version the folder (see previous point)
  • create a proxy pointing to the version of the folder (easy)
  • make the proxy folder display the versionned children and allow browsing

The third point is by far the most complicated.

There are basically 2 approaches :

  • make publishing recursive
  • "hack" the getChildren call at low level

We'll study both options :

  • first option may be the first step
  • second option is the target

First implementation

Goal

The goals of the first implementation are :

  • allow new EasySOA model to move forward ASAP
  • validate ASAP the features we want inside EasySOA
  • give us the use cases to think about complex issues (like version restore)

This means the first implementation should be quick :)

Proposed approach

Versioning hook

Implement an alternative of the VersioningService that handles versioning of folders.

Snapshot storage

Folder versioning will be available on Folderish documents that have a specific Facet (i.e. TreeVersionning or Snapshotable).

This facet will be associated to a schema that will be used to store the snapshot information.

This means the Folder version will hold the snapshot of the sub tree.

Here we have 2 solutions :

  • store all snapshot tree information in the root
    • this is consistent with EasySOA requirements
    • but storage structure is more complex
  • store in each folder version only the direct sub tree
    • this model is more generic
    • storage is simple (String Array)
    • may be simpler to implement (good fit with recusion)

=> we'll see :)

Publishing

As a first implementation, at least for now, the only simple solution I see is to have a listener that manages recursion to create a tree of proxies.

This is clearly the fastest solution unless we accept to run on a specific branch of Nuxeo code. An other advantage is that :

  • we pay the price of folder versioning at publishing time
  • it's free at rendering time
Clone this wiki locally