Carsten Ziegeler wrote:
I guess you're joking, but is this good or bad ? Who else beside Cocoon is using the source package in Excalibur ?I think it's time to define the WriteableSource etc. interfaces for the excalibur source package and move them out of Cocoon.What do you think about this? This would move the responsibility to excalibur :)
Well, look in the 2.1 scratchpad where there's a lot of yummy stuff : TraversableSource, VersionableSource, LockableSource, etc.I added before christmas the possibility to retrieve children of a source to the Source interface in excalibur and started with the ModifiableSource interface (= WriteableSource). What else do we need? I think we have a buch of extensions to the Source interface.
While working on sources recently (the CVSSource I'm about to publish), I found the current definition of TraversableSource not intuitive, and modified it so it's more like to java.io.File :
public interface TraversableSource extends Source {
/** Is the source a directory or a collection ? */
public boolean isSourceCollection() throws ProcessingException, IOException;
/** Returns the collection of child sources. */
public Collection getChildren() throws ProcessingException, IOException;
/** Returns the local name of this source */
public String getName() throws ProcessingException, IOException;
/** Return the parent source. Returns null if the source hasn't a parent. */
public Source getParentSource() throws ProcessingException, IOException;
}
Stephan, others, what about these changes ?
Carsten, I also some remarks/questions about your changes in Excalibur :
- should parent/child traversal be defined on Source. IMO, a Source should be kept very simple and basic as not all sources are traversable,
- why does getChildrenLocation return an Iterator (and not a Collection) of URIs (and Sources) ?
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]