Re: RFC: schema by interface

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>

whit wrote:
> 
> Finally, insomnia gave me enough time to try this:
> 
> http://svn.plone.org/svn/archetypes/Archetypes/branches/whitmo-schema-by-iface/
> 
> ...
> 
> Anyhoo, framework-headz have a look, give me some feedback.
> 

Having had a bit more time to think about this and look at it, and having
talked to Ben, I'm pretty excited by this. I think it may need to be
extended a bit to support some general aggregation of schemata (as in
multiple schema, not ATs silly overloading of this term) but if we could
provide a schema as some aggregation of:

 - schema set directly on the type
 - schema provided by local or global utility
 - schema provided by adapters on the type

Then all kinds of interesting use cases get solved quite elegantly. e.g.:

 - extend/override the schema of each IATDocument to make the DC:Subject
field required
 - extend/override the schema of all IATCTContent to add a required 'tags'
field
 - extend/override the schema of every content type inside a given section
of the site (with a local utility) to add a 'document-id' field to the
metadata

etc... I talked to Ben a bit at the sprint, and he said that there is a
schema provider branch of AT that has some more (pre-Zope3) functionality,
such as getting schema from parent. I'm sure making that work with the CA
should be quite easy, though. He also said that the task of
sorting/organising the schema snippets into one schema with multiple
tabs/parts/schemata should be the role of the view, not hard-coded into the
schema. I can imagine some general ISchemaSorter that is capable of
processing the aggregated schema in this way.

With the content-menu code I'm working on, alecm's viewlet heroism and this,
we'd be able to tick off the top three missing UI integration points I
outlined earlier - and it'd be a lot more feasible for third party products
to provide well-integrated tagging, topic map, ontology etc. functionality.

Whit, how do you feel about pushing this for Plone 3.0? What are the risks?
I'm assuming it works pretty seamlessly with storage, validation etc.

The main risk I could see would be that if people are being Bad (tm) and
accessing the schema via instance.schema instead of instance.Schema(),
they'll only get the on-type schema, not the whole enchilada. I'm not sure
that matters a great deal, though - we'll obviously make sure nothing in AT
or ATCT do that.

/me is excited

Martin
--
View this message in context: http://www.nabble.com/RFC%3A-schema-by-interface-t1446593.html#a4172333
Sent from the Archetypes - devel forum at Nabble.com.



-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.