the set_creation_datetime function used to
called in SilvaObject.manage_afterAdd
Now in Silva2.0, which uses zope3 events, this is placed in an event handler,
SilvaObject.object_moved, and registered on the IObjectMoved event. This
event does get called when an object is added, and it does appear to set the
creationtime.
So, jumping into SilvaObject._set_creation_datetime, I'm getting a
BindingError. Here's the traceback (of course, most relevant at the bottom):
2007-07-12 11:46:40 ERROR Zope.SiteErrorLog http://cirdan.its.bethel.edu:9180/sr/edit/add_object_submit
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.FileSystemSite.FSPythonScript, line 108, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.FileSystemSite.FSPythonScript, line 164, in _exec
Module None, line 4, in add_object_submit
- <FSPythonScript
at /sr/service_views/Silva/edit/Container/add_object_submit used
for /sr/service_views/Silva/edit/Container/Publication>
- Line 4
Module Products.FileSystemSite.FSPythonScript, line 108, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.FileSystemSite.FSPythonScript, line 164, in _exec
Module None, line 51, in add_submit
- <FSPythonScript at /sr/service_views/Silva/add/add_submit used
for /sr/service_views/SilvaDocument/add/Document>
- Line 51
Module Products.FileSystemSite.FSPythonScript, line 108, in __call__
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.FileSystemSite.FSPythonScript, line 164, in _exec
Module None, line 1, in add_submit_helper
- <FSPythonScript
at /sr/service_views/SilvaDocument/add/Document/add_submit_helper>
- Line 1
Module Products.Silva.zcml.handlers, line 196, in factory_method
Module OFS.ObjectManager, line 347, in _setObject
Module zope.event, line 23, in notify
Module zope.component.event, line 26, in dispatch
Module zope.component._api, line 130, in subscribers
Module zope.component.registry, line 290, in subscribers
Module zope.interface.adapter, line 535, in subscribers
Module zope.component.event, line 33, in objectEventNotify
Module zope.component._api, line 130, in subscribers
Module zope.component.registry, line 290, in subscribers
Module zope.interface.adapter, line 535, in subscribers
Module Products.Silva.SilvaObject, line 593, in object_moved
Module Products.Silva.SilvaObject, line 125, in _set_creation_datetime
Module Products.SilvaMetadata.MetadataTool, line 148, in getMetadata
BindingError: invalid content type Silva Document for metadata system
For Documents (and prob. all VersionedContent types that use the provided
dynamic content_factories), the object_moved event calls
_set_creation_datetime on the object (a "Silva Document"), which isn't
registered in the metadata system.
SilvaDocumentVersions, however, are registered for metadata. Looking in
SilvaObject.get_creation_datetime, the retrieval of the actual dt is on
object.get_previewable (which for versionedcontent types, returns the
previewable version).
This event is called when the Document is placed
in it's container, which happens _before_ the version is placed inside the
document.
So, I though: "subcbrive an IObjectMoved event for IVersions", since the
versions of VersionedContent don't implement ISilvaObject.
The object_moved function is now called when the version is added to the
document. However, since IVersions don't implement _set_creation_datetime,
it's still a "no go".
the set_creation_ datetime function used to manage_ afterAdd
called in SilvaObject.
Now in Silva2.0, which uses zope3 events, this is placed in an event handler, object_ moved, and registered on the IObjectMoved event. This
SilvaObject.
event does get called when an object is added, and it does appear to set the
creationtime.
So, jumping into SilvaObject. _set_creation_ datetime, I'm getting a
BindingError. Here's the traceback (of course, most relevant at the bottom):
2007-07-12 11:46:40 ERROR Zope.SiteErrorLog cirdan. its.bethel. edu:9180/ sr/edit/ add_object_ submit FileSystemSite. FSPythonScript, line 108, in __call__ DC.Scripts. Bindings, line 313, in __call__ DC.Scripts. Bindings, line 350, in _bindAndExec FileSystemSite. FSPythonScript, line 164, in _exec views/Silva/ edit/Container/ add_object_ submit used views/Silva/ edit/Container/ Publication> FileSystemSite. FSPythonScript, line 108, in __call__ DC.Scripts. Bindings, line 313, in __call__ DC.Scripts. Bindings, line 350, in _bindAndExec FileSystemSite. FSPythonScript, line 164, in _exec views/Silva/ add/add_ submit used views/SilvaDocu ment/add/ Document> FileSystemSite. FSPythonScript, line 108, in __call__ DC.Scripts. Bindings, line 313, in __call__ DC.Scripts. Bindings, line 350, in _bindAndExec FileSystemSite. FSPythonScript, line 164, in _exec views/SilvaDocu ment/add/ Document/ add_submit_ helper> Silva.zcml. handlers, line 196, in factory_method event, line 26, in dispatch _api, line 130, in subscribers registry, line 290, in subscribers adapter, line 535, in subscribers event, line 33, in objectEventNotify _api, line 130, in subscribers registry, line 290, in subscribers adapter, line 535, in subscribers Silva.SilvaObje ct, line 593, in object_moved Silva.SilvaObje ct, line 125, in _set_creation_ datetime SilvaMetadata. MetadataTool, line 148, in getMetadata
http://
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.
Module Shared.
Module Shared.
Module Products.
Module None, line 4, in add_object_submit
- <FSPythonScript
at /sr/service_
for /sr/service_
- Line 4
Module Products.
Module Shared.
Module Shared.
Module Products.
Module None, line 51, in add_submit
- <FSPythonScript at /sr/service_
for /sr/service_
- Line 51
Module Products.
Module Shared.
Module Shared.
Module Products.
Module None, line 1, in add_submit_helper
- <FSPythonScript
at /sr/service_
- Line 1
Module Products.
Module OFS.ObjectManager, line 347, in _setObject
Module zope.event, line 23, in notify
Module zope.component.
Module zope.component.
Module zope.component.
Module zope.interface.
Module zope.component.
Module zope.component.
Module zope.component.
Module zope.interface.
Module Products.
Module Products.
Module Products.
BindingError: invalid content type Silva Document for metadata system
For Documents (and prob. all VersionedContent types that use the provided datetime on the object (a "Silva Document"), which isn't
dynamic content_factories), the object_moved event calls
_set_creation_
registered in the metadata system.
SilvaDocumentVe rsions, however, are registered for metadata. Looking in get_creation_ datetime, the retrieval of the actual dt is on get_previewable (which for versionedcontent types, returns the
SilvaObject.
object.
previewable version).
This event is called when the Document is placed
in it's container, which happens _before_ the version is placed inside the
document.
So, I though: "subcbrive an IObjectMoved event for IVersions", since the
versions of VersionedContent don't implement ISilvaObject.
The object_moved function is now called when the version is added to the datetime,
document. However, since IVersions don't implement _set_creation_
it's still a "no go".