cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: repository block (was Re: [RT] Source extensions)
Date Fri, 24 Oct 2003 09:00:26 GMT


> -----Original Message-----
> From: Guido Casper [mailto:gcasper@s-und-n.de]
> Sent: donderdag 23 oktober 2003 20:22
> To: dev@cocoon.apache.org
> Subject: Re: repository block (was Re: [RT] Source extensions)
> 
> Unico Hommes <Unico@hippo.nl> wrote:
> >>>> -Adding a setSourceProperty() method to the
> >> SourceInspector interface
> >>>
> >>> Already have it on my local copy. :-)
> >>
> >> Cool! So I leave this to you :-)
> >>
> >
> > Actually I think it's better to define a subinterface named
> > SourceDescriptor that defines these methods. This would create the
> > distinction between read-only properties and read/write properties
> > nicely. Otherwise the read-only inspectors would need to throw some
> > kind of exception for those modifying methods.
> >
> > This would also mean that SourceInspectorManager becomes
> > SourceDescriptionManager and throws an exception when it is asked to
> > perform a persistent operation for a read-only property. To allow
> > clients to asses whether a SourceProperty is read-only I propose to
> > add an isModifiable() method on the SourceProperty. To avoid that
> > users think SourceProperty.setValue() will persist their
> > modifications perhaps it is better to remove that method.
> 
> All this makes sense IMO.
> 
> >
> > A related change I need to make is described here:
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23699 this will
not
> > only improve performance of querying for a specific property but is
> > prerequisite for setting properties via the
SourceDescriptionManager.
> 
> I'm not sure.
> What exactly is the meaning of the returned Strings?
> 

They identify a property type: namespace + "#" + propname. The previous
implementation of the inspector manager's getSourceProperty() method was
looping over all registered inspectors until it found the property it
was looking for.

In order to make this process more efficient the manager needs to
register the individual inspectors to handle specific properties. The
getExposedPropertyTypes() method enables this.

> Is it all properties "supported" by a particular SourceInspector
> implementation?

Yes.

> What if it supports any within a particular namespace?
> What if it support any within any namespace?
> 
> How would that be represented?

Nothing in place for that yet, but we could add it easily. Just need a
convention. What about using wildcards for this:

*#myprop
myns#*
*#*

This way a simple jdbc descriptor that stores properties as key value
pairs in a database can assert it is general enough to handle any
property. The manager then looks for an inspector in order from most
specific (exact match) to least specific (*#*).

Sound OK?

> 
> Guido


Mime
View raw message