我正在尝试让contentmirror产品与plone4站点一起使用。我已经从头开始创建了一个buildout,并且只包含了这个链接指示的contentmirror包: http://code.google.com/p/contentmirror/wiki/Installation
我已根据文档中包含的说明在mysql数据库中设置表。
当我创建我的plone网站时,我收到以下错误:
2011-04-19 15:00:56,768 INFO sqlalchemy.engine.base.Engine.0x...8d2c SELECT DATABASE()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c SELECT DATABASE()
2011-04-19 15:00:56,768 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56,772 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'character_set%%'
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'character_set%%'
2011-04-19 15:00:56,773 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56,774 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'lower_case_table_names'
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'lower_case_table_names'
2011-04-19 15:00:56,775 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56,776 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW COLLATION
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW COLLATION
2011-04-19 15:00:56,777 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56,781 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'sql_mode'
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c SHOW VARIABLES LIKE 'sql_mode'
2011-04-19 15:00:56,781 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ()
2011-04-19 15:00:56,784 INFO sqlalchemy.engine.base.Engine.0x...8d2c BEGIN (implicit)
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c BEGIN (implicit)
2011-04-19 15:00:56,790 INFO sqlalchemy.engine.base.Engine.0x...8d2c INSERT INTO content (id, content_uid, object_type, status, portal_type, folder_position, container_id, path, relative_path, title, description, subject, location, contributors, creators, creation_date, modification_date, effectivedate, expirationdate, language, rights, excludefromnav) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c INSERT INTO content (id, content_uid, object_type, status, portal_type, folder_position, container_id, path, relative_path, title, description, subject, location, contributors, creators, creation_date, modification_date, effectivedate, expirationdate, language, rights, excludefromnav) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
2011-04-19 15:00:56,791 INFO sqlalchemy.engine.base.Engine.0x...8d2c ('Members', 'f4363fe1b35567b62fc3283940928e66', 'ATFolderPeer', 'published', 'Folder', 62, None, '/Plone/Members', 'Members', 'Users', 'Site Users', '', '', '', 'admin', datetime.datetime(2011, 4, 19, 15, 0, 56, 349822), datetime.datetime(2011, 4, 19, 15, 0, 56, 391794), None, None, 'en', '', 0)
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ('Members', 'f4363fe1b35567b62fc3283940928e66', 'ATFolderPeer', 'published', 'Folder', 62, None, '/Plone/Members', 'Members', 'Users', 'Site Users', '', '', '', 'admin', datetime.datetime(2011, 4, 19, 15, 0, 56, 349822), datetime.datetime(2011, 4, 19, 15, 0, 56, 391794), None, None, 'en', '', 0)
/plone/dev_PloneCache/eggs/SQLAlchemy-0.6.7-py2.6.egg/sqlalchemy/engine/default.py:299: Warning: Field 'content_id' doesn't have a default value
cursor.execute(statement, parameters)
2011-04-19 15:00:56,795 INFO sqlalchemy.engine.base.Engine.0x...8d2c INSERT INTO content (id, content_uid, object_type, status, portal_type, folder_position, container_id, path, relative_path, title, description, subject, location, contributors, creators, creation_date, modification_date, effectivedate, expirationdate, language, rights, excludefromnav) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c INSERT INTO content (id, content_uid, object_type, status, portal_type, folder_position, container_id, path, relative_path, title, description, subject, location, contributors, creators, creation_date, modification_date, effectivedate, expirationdate, language, rights, excludefromnav) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
2011-04-19 15:00:56,796 INFO sqlalchemy.engine.base.Engine.0x...8d2c ('events', '5d2236341ffc7568c0550a3ebf3cefb8', 'ATFolderPeer', 'published', 'Folder', 61, None, '/Plone/events', 'events', 'Events', 'Site Events', '', '', '', 'admin', datetime.datetime(2011, 4, 19, 15, 0, 56, 118873), datetime.datetime(2011, 4, 19, 15, 0, 56, 119133), None, None, 'en', '', 0)
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ('events', '5d2236341ffc7568c0550a3ebf3cefb8', 'ATFolderPeer', 'published', 'Folder', 61, None, '/Plone/events', 'events', 'Events', 'Site Events', '', '', '', 'admin', datetime.datetime(2011, 4, 19, 15, 0, 56, 118873), datetime.datetime(2011, 4, 19, 15, 0, 56, 119133), None, None, 'en', '', 0)
2011-04-19 15:00:56,797 INFO sqlalchemy.engine.base.Engine.0x...8d2c ROLLBACK
2011-04-19 15:00:56 INFO sqlalchemy.engine.base.Engine.0x...8d2c ROLLBACK
2011-04-19 15:00:56 ERROR Zope.SiteErrorLog 1303239656.80.428376990883 http://aktplone02:51002/@@plone-addsite
Traceback (innermost last):
Module ZPublisher.Publish, line 135, in publish
Module Zope2.App.startup, line 291, in commit
Module transaction._manager, line 93, in commit
Module transaction._transaction, line 316, in commit
Module transaction._transaction, line 366, in _callBeforeCommitHooks
Module ore.contentmirror.operation, line 212, in flush
Module sqlalchemy.orm.session, line 1392, in flush
Module sqlalchemy.orm.session, line 1473, in _flush
Module sqlalchemy.orm.unitofwork, line 302, in execute
Module sqlalchemy.orm.unitofwork, line 446, in execute
Module sqlalchemy.orm.mapper, line 1884, in _save_obj
Module sqlalchemy.engine.base, line 1191, in execute
Module sqlalchemy.engine.base, line 1271, in _execute_clauseelement
Module sqlalchemy.engine.base, line 1302, in __execute_context
Module sqlalchemy.engine.base, line 1401, in _cursor_execute
Module sqlalchemy.engine.base, line 1394, in _cursor_execute
Module sqlalchemy.engine.default, line 299, in do_execute
Module MySQLdb.cursors, line 174, in execute
Module MySQLdb.connections, line 36, in defaulterrorhandler
IntegrityError: (IntegrityError) (1062, "Duplicate entry '0' for key 1") 'INSERT INTO content (id, content_uid, object_type, status, portal_type, folder_position, container_id, path, relative_path, title, description, subject, location, contributors, creators, creation_date, modification_date, effectivedate, expirationdate, language, rights, excludefromnav) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' ('events', '5d2236341ffc7568c0550a3ebf3cefb8', 'ATFolderPeer', 'published', 'Folder', 61, None, '/Plone/events', 'events', 'Events', 'Site Events', '', '', '', 'admin', datetime.datetime(2011, 4, 19, 15, 0, 56, 118873), datetime.datetime(2011, 4, 19, 15, 0, 56, 119133), None, None, 'en', '', 0)
2011-04-19 15:00:56 ERROR ZServerPublisher exception caught
Traceback (most recent call last):
File "/plone/dev_PloneCache/eggs/Zope2-2.12.13-py2.6-linux-i686.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
response=b)
File "/plone/dev_PloneCache/eggs/Zope2-2.12.13-py2.6-linux-i686.egg/ZPublisher/Publish.py", line 438, in publish_module
environ, debug, request, response)
File "/plone/dev_PloneCache/eggs/Zope2-2.12.13-py2.6-linux-i686.egg/ZPublisher/Publish.py", line 264, in publish_module_standard
if request is not None: request.close()
File "/plone/dev_PloneCache/eggs/Zope2-2.12.13-py2.6-linux-i686.egg/ZPublisher/BaseRequest.py", line 215, in close
notify(EndRequestEvent(None, self))
File "/plone/dev_PloneCache/eggs/zope.event-3.4.1-py2.6.egg/zope/event/__init__.py", line 23, in notify
subscriber(event)
File "/plone/dev_PloneCache/eggs/zope.component-3.7.1-py2.6.egg/zope/component/event.py", line 26, in dispatch
for ignored in zope.component.subscribers(event, None):
File "/plone/dev_PloneCache/eggs/zope.component-3.7.1-py2.6.egg/zope/component/_api.py", line 138, in subscribers
return sitemanager.subscribers(objects, interface)
File "/plone/dev_PloneCache/eggs/zope.component-3.7.1-py2.6.egg/zope/component/registry.py", line 323, in subscribers
return self.adapters.subscribers(objects, provided)
AttributeError: adapters
因此无法创建网站。我试过放下桌子,但是弹出另一个错误,表示找不到桌子,所以我觉得我的方向正确。
我正在尝试查看这是否是一种将内容存储到sql数据库的可行方法,正如一些页面所指出的那样。我在这里肯定遗漏了一些东西。有没有人有使用这个产品来帮助我的经验?
感谢。 年轻的金
答案 0 :(得分:3)
免责声明:我没有使用ContentMirror的经验,因此我可能完全脱离目标,但从您发布的内容来看,“id”值似乎没有针对表'内容'自动增加。
在SQLAlchemy中,这是由一个覆盖默认行为的错误设置引起的,例如
Table('content', metadata,
Column('id', Integer, primary_key=True, autoincrement=False),
...
)
在使用'ddl.py'脚本生成的SQL文件('mirror.sql')中,检查表'content'的相应数据库模式定义是否将列的属性'AUTO_INCREMENT'设置为'TRUE' 'id',如下例所示:
CREATE TABLE `content` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
...
)