同步plone实例之间的内容
collective.synchro的Python项目详细描述
同步内容的工具beetwen plone instance
如何安装?
o在plone3中,转到portal_quickinstaller并安装collective.synchro
o在plone2.5中,转到portal_设置,在properties中选择collective synchro as 活动配置并在导入中单击导入所有步骤
它是怎么工作的?
这个工具通过插件导入内容。默认情况下有三个插件:fss、zexp和delete 您可以为您的用例添加和编写新的插件(请参见plugin.txt)
它将导出的数据存储在文件系统中,以便在 另一个实例(或多个实例)。外部程序必须将数据复制到导入队列。 这个egg为ssh传输提供了一个脚本。 添加buildout(buildout的示例可在collective/synchro/buildout目录中找到)此部分配置脚本:
[synchro] recipe = zc.recipe.egg eggs = collective.synchro extra-paths= ${instance:location} ${zope2:location}/lib/python
这将在构建三个脚本的容器中创建:
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)
重要的是,导入队列必须与zeoclient实例一起运行:
>>> bin/instance run bin/import_queue ...
同步是由zope3事件系统触发的。有一个泛型方法 所有事件调用:collective.synchro.events.synchro。
插件是按事件选择的(objectmodified和objectremovedevent的插件列表不同)。 此注册表由同步工具管理
导入的本地化是通过查询一个多适配器来完成的,该适配器决定了内容的位置 重新进口。您可以通过zca更改导入内容的本地化。
队列的结构如下:
./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
如何配置导出?
转到ZMI,在“门户同步配置”中:
o queues : filesystem path (create if don't exits, one queue for one instance) o expressions : a tal expression that must be true to synchronized content
兼容性
此包装在PLONE2.5和PLONE3.1中进行测试
待办事项
o interface to register/unregister plugins in zmi
o callback for imported content
更改日志
1.0.2-符合plone2.5.2
- 用5个1.4.2对plone2.5.2进行测试
- 导入后重新索引对象
- 修复五个1.4.2的fss导入
1.0.1-初始值
- 将脚本添加到synchronized并导入内容
- 修复delete plugin中的错误(请参阅export.txt)
1.0.0-未发布
- 初始版本