Terminology:
- SDM: Source Document Manager (e.g. the default manager in Sulu).
- TDM: Target Document Manager (e.g. the live document manager in Sulu).
- synchronize: To copy the state of something to or from a TDM.
- push: Synchronize from the SDM to a TDM.
- pull: Synchronize to the SDM from a TDM.
- draftable: When something MUST be manually synchronized to a TDM.
- non-draftable: When something is automtaically synchronized to a TDM.
- path conflict: When a SDM node is pushed to the TDM, but the path is already occupied on the TDM by an as-of-yet not synchronized node.
- All documents which can be synchronized must (at this stage) implement the
SynchronizeBehavior.
Sulu\Bundle\ContentBundle\Document\BasePageDocument:
auto_sync: [ "delete", "move" ]
delete_references: true
cascade_referrers:
- Sulu\Bundle\ContentBundle\Document\RouteDocument
Sulu\Bundle\ContentBundle\Document\RouteDocument:
auto_sync: []
cascade_referrers:
- Sulu\Bundle\ContentBundle\Document\RouteDocument- Pages MUST not be automatically synched, except on
deleteandmove. - When a page is moved, it MUST also be moved in the TDM.
- When a page is deleted it MUST also be removed from the TDM.
- When a page is deleted from SDM, any references to this page in the TDM should be removed.
- Routes MUST not be automatically synched.
- Pages MUST be immediately deleted from the TDM when deleted from the SDM.
- Any referring routes which exist in the TDM and do not exist in the SDM should be deleted from the TDM.
- auto-incrementing integer.
- Route document "push" operations MUST cascade to any history routes.
- All other documents should be fully synchronized at all times.
Reasons:
- Pages are draftable
- (also 3.) Moving is not within the scope of the document edit page, so user has no control over this. documents are hard-deleted.
- Because pages are removed automatically.
- User cannot manually syncronize the deleted status of a document -
- Othewise we have a garbage problem (and risk of potential conflicts).
- (applies only when moving is draftable).
- History routes are dependent upon the "primary" route.
- Otherwise the site is probably useless.
Issues:
- (when moving is draftable) potential for path conficts (handled by 6).
- Potential to push content to the TDM which references pages that are not synchronized to the TDM (we should probably ask the user if they also want to publish the related page).
Sulu\Bundle\ContentBundle\Document\BasePageDocument:
auto_sync: [ "new", "delete", "move" ] # no "update" sync.
Sulu\Bundle\ContentBundle\Document\RouteDocument:
auto_sync: [ "new", "update", "delete" ]- When a
RouteDocumentinstance is deleted, it should be immediately removed from the TDM. - When a
RouteDocumentis created or updated it should be immediately synchronized to the TDM. RouteDocumentoperations should cascade any history routes (which are instances ofRouteDocument).- When a
PageDocumentinstance is saved it will NOT need to cascade the routes, as they will already be present. - When a
PageDocumentinstance is created it MUST be created in the TDM. - All other documents should be fully synchronized at all times.
Issues:
- Drafting history documents are synchronized to the live server as edits are made.
- The user would not intuitively realise that they are changing the URL structure of their site when editing a document, they should be notified that this will happen.
- The synchronization manager is not responsible for resetting the synchronization status of the referrered to document when a cascaded relation is persisted independently.
- The
PageDocumentshould be manually set into a de-syncronized state after a history route has been restored. (either via. the document manager or theSynchronizationManager).