cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject New JCR block
Date Sat, 23 Apr 2005 08:22:14 GMT
Hi all,

I just committed a new JCR block. This block provides two features: a 
Repository component, and a "jcr:" protocol.

The Repository component is nothing more than the standard 
javax.jcr.Repository interface, but provides a way to centrally define 
how to access the repository (Jackrabbit conf file, JNDI, etc) and how 
to obtain credentials to log into the repository. There's currently only 
one concrete implementation that uses Jackrabbit.

The JCR source factory is more interesting, as it provides a traversable 
and modifiable source that hides away the details of the repository 
structure and node types. To achieve this, we need to configure it by 
defining a mapping from node types to "files" and "folders" that will be 
visible through the "jcr:" protocol.

The result is that we can now use a JCR repository in Cocoon just like 
we use the regular filesystem.

As an example, here's how this source factory is configured for the 
standard filesystem-like node types defined by JCR:
     <component-instance 
class="org.apache.cocoon.jcr.source.JCRSourceFactory" name="jcr">
       <folder-node type="rep:root"  new-file="nt:file" 
new-folder="nt:folder"/>
       <folder-node type="nt:folder" new-file="nt:file"/>
       <file-node type="nt:file" content-path="jcr:content" 
content-type="nt:resource"/>
       <file-node type="nt:linkedFile" content-ref="jcr:content"/>
       <content-node type="nt:resource"
             content-prop="jcr:data"
             mimetype-prop="jcr:mimeType"
             lastmodified-prop="jcr:lastModified"
             validity-prop="jcr:lastModified"/>
     </component-instance>

More detailed information about this configuration is given in 
o.a.c.jcr.source.JCRSourceFactory's javadoc.

This source factory is still a bit primitive regarding all features 
provided by JCR. Future enhancements include querying the repository, 
handling workspaces, node properties, versions, etc.

Your feedback and opinions about this initial implementation and its 
future evolutions are more than welcome!

Enjoy,
Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message