On Tue, 2006-29-08 at 13:57 +0200, Jean Jordaan wrote:
> >
'WeAreSorryWeShouldHaveKnownBetterThanToDesignOurSystemArou
ndPrematureObjectCreation
>
> Hehe. This makes we wonder whether object creation *in
a temp folder* might
> raise a different event, or an additional one. So that
it's possible to
> subscribe only to the creation of objects that will
persist.
Here is what should technically happen when creating a new
instance of a
content type that uses portal_factory.
1. Object is created in temp folder via portal_factory.
IObjectCreatedEvent should be fired.
2. Object is modified and saved (which is what Plone
considers to be
created in this case). IObjectModifiedEvent should be
fired.
The sane approach would probably in #2 be to create a new
event class
that extends IObjectModifiedEvent, probably call it
IArchetypeFirstModifiedEvent and fire that instead. In my
mind that
would solve the "what the world should expect to
happen" use case and
the "but we're in plone, this is really when the
object was first
created" use case us plone weenies expect.
While we're at it, we should probably define
IArchetypeCreatedEvent and
IArchetypeModifiedEvent and fire those too.
But, I intentionally didn't try doing any of this for AT
1.4. I think
the simple quick fix now for AT 1.4 would be to replace my
IObjectCreatedEvent with an IObjectModifiedEvent call and
then perhaps
for AT 1.5 we can do it right.
What do you all think?
- Rocky
--
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net
------------------------------------------------------------
-------------
Using Tomcat but need to do more? Need to support web
services, security?
Get stuff done quickly with pre-integrated technology to
make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&a
mp;kid=120709&bid=263057&dat=121642_________________
______________________________
Archetypes-devel mailing list
Archetypes-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archet
ypes-devel
|