[Framework-Team] Three PLIPs ready for review

2010-08-28 Thread Martin Aspeli
Hi,

The following are ready for review:

https://dev.plone.org/plone/ticket/9472 - plone.app.registry
https://dev.plone.org/plone/ticket/9473 - z3c.form
https://dev.plone.org/plone/ticket/10856 - plone.testing

They are all testable through the same buildout, since p.a.registry
depends on z3.form and plone.testing and I'm too lazy to crete three
buildouts. :)

This is in the 4.1 buildout under
plips/plip9472-9473-registry-z3cform.cfg. See comments in the file to
see which packages to run tests for (all tests pass here) and which
packages will eventually need to go into the Plone KGS.

Note that plone.registry and plone.app.registry point to branches
which contain some ZODB optimisation work. I've asked Laurence to take
a close look at this, since these changes were largely in response to
his critique. However, I don't think that should hold up review. In
time, I'll just merge these branches to trunk and update the PLIP
buildout.

Cheers,
Martin
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team


Re: [Framework-Team] Three PLIPs ready for review

2010-08-28 Thread Eric Steele
On Aug 28, 2010, at 10:19 AM, Martin Aspeli wrote:
 Hi,
 
 The following are ready for review:
 
 https://dev.plone.org/plone/ticket/9472 - plone.app.registry
 https://dev.plone.org/plone/ticket/9473 - z3c.form
 https://dev.plone.org/plone/ticket/10856 - plone.testing
 ...


Thanks Martin.

FWT, I've added the above to the ready for review section of our tracking 
spreadsheet (see the initial reviews tab). WIth Laurence's PLIP, that makes 
four that are ready to look at. Since we're spreading out the review process a 
bit more this time and I want to make sure we're a lot more picky about what 
goes into a minor release, I'd like to have at least 3 reviewers for each. 

Eric
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team


Re: [Framework-Team] Three PLIPs ready for review

2010-08-28 Thread Jon Stahl
On Sat, Aug 28, 2010 at 7:41 AM, Eric Steele ems...@psu.edu wrote:
 On Aug 28, 2010, at 10:19 AM, Martin Aspeli wrote:
 Hi,

 The following are ready for review:

 https://dev.plone.org/plone/ticket/9472 - plone.app.registry
 https://dev.plone.org/plone/ticket/9473 - z3c.form
 https://dev.plone.org/plone/ticket/10856 - plone.testing

I just want to comment that I am *very* impressed that we have
reviewable PLIPs for 4.1 before 4.0 is formally out the door.  Nice
work, Martin!

:jon
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team


Re: [Framework-Team] Three PLIPs ready for review

2010-08-28 Thread Martin Aspeli
On 28 August 2010 23:54, Jon Stahl jonst...@gmail.com wrote:
 On Sat, Aug 28, 2010 at 7:41 AM, Eric Steele ems...@psu.edu wrote:
 On Aug 28, 2010, at 10:19 AM, Martin Aspeli wrote:
 Hi,

 The following are ready for review:

 https://dev.plone.org/plone/ticket/9472 - plone.app.registry
 https://dev.plone.org/plone/ticket/9473 - z3c.form
 https://dev.plone.org/plone/ticket/10856 - plone.testing

 I just want to comment that I am *very* impressed that we have
 reviewable PLIPs for 4.1 before 4.0 is formally out the door.  Nice
 work, Martin!

Mmm, technically these are kind of meta-PLIPs that only talk about the
inclusion of existing packages. I didn't actually do much work beyond
make a buildout. :)

That said, I'm working on the UUID PLIP now ;-)

Martin
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team


[Framework-Team] PLIP #10778 (UUIDs) - ready for initial review

2010-08-28 Thread Martin Aspeli
All,

Following our rather lengthy discussion, I've made some changes to
PLIP #10778, which I hope alleviate the concerns associated with this
PLIP.

This is now ready for testing. I've piggy-backed on David's PLIP #9938
buildout (plips/plip9938-output-filters.cfg), since his improved
transforms will use the plone.uuid API to be non-Archetypes-specific.
I've offered to support him in that PLIP, so there may yet be some
changes desired in the PLIP #10778 code (plone.uuid, plone.app.uuid
and the plip10778-plone.uuid branch of Products.Archetypes), although
on its own, I think this PLIP is now ready for review.

Instead of describing the changes from the old code, I'll try to
explain how the PLIP is now structured:

= plone.uuid =

plone.uuid provides a simple API for generating and accessing UUIDs.

The principal API is the IUUID() adapter factory, which can be used to
return a (byte string) UUID. There is also an IUUIDGenerator utility
to generate new UUIDs. The default implementation uses the standard
library uuid.uuid1() method.

plone.uuid provides a marker interface IUUIDAware. Objects with this
marker are expected to be adaptable to IUUID. There is an @@uuid view
which renders a UUID string for an IUUIDAware object. This is useful
in TAL, for example.

plone.uuid also provides a specialisation of IUUIDAware called
IAttributeUUID. Types that provide this interface get an
IObjectCreatedEvent handler that generates and assigns a UUID stored
in an attribute on the object, plus an IUUID adapter that looks up
this attribute.

= plone.app.uuid =

plone.app.uuid provides some Plone policy for UUIDs.

It contains a catalog indexer (using plone.indexer) for IUUIDAware
objects, using the IUUID adapter factory. The indexer name is UID,
to be compatible with the existing UID index/metadata. Therefore,
there is (no longer) a separate catalog setup step, and no migration
required for existing Archetypes based content.

plone.app.uuid also provides a view, @@redirect-to-uuid, which can be
passed a UUID on the traversal subpath. This is then looked up in the
catalog, before a redirect response is sent to the object's current
location.

There are also some utility functions to find objects by UUID in various ways.

= Archetypes =

The branch of Products.Archetypes makes Archetypes use plone.uuid to
generate its UUIDs. The net effect is that the plone.uuid and
plone.app.uuid APIs work for all Archetypes content (without
migration), but can also be made to work with other objects.

Archetypes objects are marked with IUUIDAware (but not
IAttributeUUID). This makes the indexer, and @@uuid and
@@redirect-to-uuid views work.

UUIDs are still stored (in the _at_uid attribute) and created (by
voodoo-wielding elves) in the same way as before.

The make_uuid() function, which generates new UUIDs, now delegates to
the IUUIDGenerator utility[1]. There is no migration for old content,
but there isn't any need: UUIDs are still strings, and can't collide,
even though technically new content will use a different algorithm. I
did some tests TTW with references created before and after, and
they worked fine.

There is an IUUID adapter factory for IReferenceable (which covers all
Archetypes objects and, insanely, reference objects[2]). This returns
the Archetypes UUID as stored in the _at_uid attribute, just as the
UID() method used to do.

The UID() method now does return IUUID(self, None). This means that
if someone wanted to implement a custom IUUID adapter, the UID()
method would follow suit.

In theory, we could probably deprecate context.UID() metod in favour
of IUUID(context) (in Python code) and context/@@uuid (in TAL), but
I'm not sure we'd want to. It's used quite a lot. The plone.uuid way
is more broadly compatible, though.

= Dexterity et. al. =

This isn't really part of the PLIP, but if the PLIP is accepted, I'll
add plone.uuid support for Dexterity objects. That'll be pretty easy:
just mark them with IAttributeUUID. We probably also want a migration
step that grants UUIDs to and re-catalogs old Dexterity content.

Presuming David finishes his work on plone.outputtransforms, this
means link-by-uid to Dexterity content becomes a reality. We can maybe
also make the standard reference browser widget work for non-AT
content. UUIDs also become a viable thing to store for portlets and
tiles that want to reference content.

I also think we should consider adding UUIDs to comments if the
plone.app.discussion PLIP is accepted.

Cheers,
Martin

[1] I also took the opportunity to remove some weird, unused code
attempting to use a Linux kernel UUID generator in /proc.
[2] Whoever though people would *really* need references to references
deserves to be locked in a room with Jeremy Beadle for two days
___
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team