contentmirror integration with plone 4
I am trying to get the contentmirror product to work with a plone4 site. I've created a buildout from scratch and only included the contentmirror packages as indicated by this link: http://code.google.com/p/contentmirror/wiki/Installation
I've set up the tables in a mysql database according to the instructions included in the documentation.
When I create my plone site, I get the following error:
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', '5d22开发者_如何学JAVA36341ffc7568c0550a3ebf3cefb8', '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
So the site fails to get created. I've tried dropping the table, but another error pops up indicating it cannot find a table, so I think I'm in the right direction.
I'm trying to see if this is a viable means to store content to a sql database as some pages have indicated. I am definitely missing something here. Does anyone have any experience using this product to help me out?
Thanks. Young Kim
Disclaimer: I have no experience using ContentMirror, so I might be totally off-target, but from what you posted it seems that the 'id' value is not being autoincremented for table 'content'.
In SQLAlchemy, this is caused by an erroneous setting that overrides the default behaviour, something like
Table('content', metadata,
Column('id', Integer, primary_key=True, autoincrement=False),
...
)
In the SQL file ('mirror.sql') you generated using the 'ddl.py' script, check that the corrisponding database schema definition for table 'content' has the attribute 'AUTO_INCREMENT' set to 'TRUE' for column 'id', as in the following example:
CREATE TABLE `content` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
...
)
精彩评论