Re: Simple useful events
Rocky Burt <[email protected]> Tue, 29 Aug 2006 10:02:31 -0230
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Organization | ServerZen Software |
| Message-ID | <1156854749.21151.29.camel@localhost> |
--===============0943440165== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-CATiCdQc0ESLN4nxdadf" --=-CATiCdQc0ESLN4nxdadf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2006-29-08 at 13:57 +0200, Jean Jordaan wrote: > > 'WeAreSorryWeShouldHaveKnownBetterThanToDesignOurSystemAroundPrematureO= bjectCreation >=20 > Hehe. This makes we wonder whether object creation *in a temp folder* mig= ht > 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 --=20 Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net --=-CATiCdQc0ESLN4nxdadf Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBE9DPc1PysfgyHvo0RAqO3AJ43P58doSxlr55R3YG5x2bB1FgCcACeMDmV VyhO9VZqWcPqDizussQx8VA= =8Ewk -----END PGP SIGNATURE----- --=-CATiCdQc0ESLN4nxdadf-- --===============0943440165== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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&kid=120709&bid=263057&dat=121642 --===============0943440165== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Archetypes-devel mailing list Archetypes-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/archetypes-devel --===============0943440165==--