cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Michels <>
Subject [PROPOSAL] Sources, the next generation RE: Speedup *DirectoryGenerator
Date Fri, 14 Jun 2002 19:09:56 GMT

On Fri, 14 Jun 2002, Per Kreipke wrote:

> > *DirectoryGenerators should be refactored so we have the only
> > DirectoryGenerator with pluggable 'processors' of different file types.
> > This way, you will be able to generate listings of different files of
> > type in one directory.
> That's a great idea but more grandiose. It certainly would be neat if you
> could (use POI to) extract metadata from MS Office files, etc. I imagine
> there are actually code libraries out there for all kinds of 'file
> introspection' or generating metadata from files.

At the moment I'm to evaluating way to get meta informations from
repositories, like slide or over WebDAV. Also I want to be grant
permissions and locks to sources. My initial stage was creating
'SourceDescriptor', which is now in current CVS. But more I think about
it as more I came to the conclusion that I should follow the SoC.
The next idea is create some interfaces for 'Source' similar to

So I have the following proposal:


  /** if the source a directory */
  boolean isCollection();

  /** Return the children of the collection */
  Enumeration getChildSources();


  /** To get a meta information from a source */
  SourceProperty getSourceProperty(String namespace, String name);

  /** To set a meta information */
  void setSourceProperty(SourceProperty property);

  /** Get alll informations */
  Enumeration getSourceProperties()


  /** Get a permission for a owner */
  SourcePermission getSourcePermission(String owner);

  /** Get a permission for the local owner */
  SourcePermission getSourcePermission();

  void setSourcePermission(SourcePermission permission);

  Enumeration getSourcePermissions();


  /** Get a lock for a owner */
  SourcePermission getSourceLock(String owner);

  /** Get a lock for the local owner */
  SourceLock getSourceLock();

  void setSourceLock(SourceLock lock);

  Enumeration getSourceLocks();

The interface InformalSource could be used to get properties
from a source, such like image width and height

SourceProperty: namespace
                name width
                value 480

The values should also contain XML fragment like
SourceProperty: namespace
                name title
                value bla from <a>dgfdh</a>

The next thing is that cocoon is able to browse through repositories
At the moment DirectoryGenerator is limited to the file:// protocol, I

I would also come to the point cachable. Source can IHMO implement
recycable, to there is no need to retrieve all meta informations
for every request.

I had also took a look Ugo Cei's implementation of CocoBlog. He used RSS
to create a description for every entry in xindice. I doesn't understand
the difference between RSS and RDF. So I used for my first stage RDF.
So my proposal is to write a 'SourceDescriptionGenerator'. It should
work like DirectoyGenerator, catch all informations from a source, and
generate a 'Resource Description'.

One think, I doen't know to implement is associate 'SourceCredentials'
to the source, such like username and password.

Perhaps a ExtendedSourceFactory a possibility:

   Source getSource(SourceCredential credential, String location, Map

So, what do you think, is this the right way?

Stephan Michels.

To unsubscribe, e-mail:
For additional commands, email:

View raw message