collective.synchro (1.0.2)
- collective.synchro download link: http://pypi.python.org/packages/source/c/collective.synchro/collective.synchro-1.0.2.tar.gz#md5=3037403760d3d9d3d66c3419f7bf8251
- Homepage of collective.synchro: http://pypi.python.org/pypi/collective.synchro
- collective.synchro repository: https://svn.plone.org/svn/collective/collective.synchro
- Description source: http://pypi.python.org/pypi/collective.synchro
How it work ?
This tool import content via plugin. By default there is three plugins : fss, zexp and delete You can add and write new plugin (see PLUGIN.txt) for your use case
It store exported data in file system in order to be reimported in an another instance (or multiple instance). An external program must copy data to an import queue. This egg provide a scripts for ssh transport. Add in your buildout (example of buildout are available in collective/synchro/buildout directory) this part to configure scripts:
[synchro]
recipe = zc.recipe.egg
eggs =
collective.synchro
extra-paths=
${instance:location}
${zope2:location}/lib/python
This create in your bin of buildout three scripts :
o bin/create_queue -d PATH, --directory=PATH , create a queue structure
o bin/synchronize_queue -s SOURCE -d DEST , synchronize queue by ssh (via ssh key) (-h for other options)
o bin/import_queue -p PATH , import data from queue (-h for other options)
Important, the import_queue must be run with an zeoclient instance:
>>> bin/instance run bin/import_queue ...
The synchronization is fire by the zope3 event system. There is a generic method call by all events : collective.synchro.events.synchro.
Plugin are choice by event (plugin list for ObjectModified and ObjectRemovedEvent are different). This registry is managed by the synchronization_tool
The localisation of import is done by queyring a multiadapter that decide where the content is reimported. You can change by zca, the localisation of your import content.
The structure of a queue looks like as this:
./IMPORT
./IMPORT/TO_PROCESS -> all files in order to process
./IMPORT/DONE -> file that are synchronized with an EXPORT queue
./IMPORT/ERROR -> data in error
./IMPORT/PROCESSING -> files are synchronizing with an EXPORT queue
./EXPORT
./EXPORT/TO_PROCESS -> files that are scheduled to export
./EXPORT/DONE -> files that are imported in the instance
./EXPORT/ERROR -> files in error
./EXPORT/PROCESSING -> files are importing from queue