You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Gerd Schrick <gs...@epo.org> on 2007/11/09 18:15:35 UTC

Re: JCR-Module for Lenya2

Thanks for the response!
Reading the answer I realized that I was not really precise... so I add 
some more details

my current approach/idea to use JackRabbit with Lenya2 is:
replace the "sourcerepository"-module with a module "jcrrepository".
Basically the "jcrrepository"-module will provide all the (required) 
features of "sourcerepository" but uses JCR/JackRabbit instead of the 
filesystem to store the data. I won't just replace the filesystem by JCR 
(using it only as a storage) but also use features like version 
management, (node)locking etc. as provided by the JCR-repository.

In my approach I assume that the "sourcerepository" is the (only) 
interface between Lenya2 and its data-storage - meaning: any read/write 
access to the data-storage is managed (only) by that module.
Am I right with this?
So my first question should have been: What does Lenya expect/need from a 
module that should replace "sourcerepository"?

Some words about what I've already done:
- build a module "jcrrepository" (as described in the documentation)
- defined/registered lenya-nodetypes in the JCR
- import to jcr usecase based on the one in the "old" jcr-module
- import the content from the sourcerepository to JakRabbit
- in cocoon.xconf I then changed class for role 
org.apache.lenya.cms.repository.NodeFactory to the one in the new module

ATM I'm able to navigate thru the site (in authoring), view (existing) 
content and edit it.
To be sure that (only) JackRabbit provides the content I've deleted the 
"content" directory in the publication.

Sure, there are still many (most) things missing and the development is in 
an very early stage but for me the approach seems promising.

What do you think about this?


Best regards,
 Gerd

just to be mentioned: as soon as the module is useable (also if not final) 
I'm willing to contribute it


news <ne...@ger.gmane.org> wrote on 31-10-2007 15:15:56:

> Gerd Schrick schrieb:
> > 
> > Dear Lenya Team,
> > 
> > some months ago I asked for the state of the JCR-module (to use Lenya
> > with JackRabbit)...
> > and since some weeks I'm working myself on the implementation of such 
a
> > module.
> > After the first frustrating steps "in the dark" the work becomes
> > more-and-more successful...
> > 
> > ATM I'm stuck a bit on two things:
> > 1) how can I find out what Lenya really expects from such a module 
(what
> > objects/classes/methods)?
> 
> http://lenya.apache.org/docs/2_0_x/reference/modules/index.html
> 
> A module is not required to contain any classes.
> 
> >- until now, I looked up the
> > sourcerepository-module (and the old/outdated JCR module) tried to 
find
> > out what's going on there and then created my own module with similar
> > classes...
> > I'm not sure if this is a really good approach, so I hope to get some
> > help/hints on how to proceed best.
> 
> IMO the only reasonable approach would be to integrate JCR at a higher
> level (i.e. implementing the o.a.lenya.cms.publication.* interfaces),
> which would probably require to change the API. The repository module
> (now in the sandbox) was a draft how this could be accomplished.
> 
> > 2) the classes I looked up in the sourcerepository module are all
> > subclasses of "AbstractLogEnabled".
> > For many classes/objects I found in sourcerepository I found a
> > equivalent in javax.jcr. Currently I just use these objects (mostly
> > instances of javax.jcr...) as members in classes extending
> > AbstractLogEnabled and implementing the required interfaces.
> > But is there also an option to create them as subclasses from the
> > classes in the javax.jcr-package instead? (with additional interfaces)
> 
> I wouldn't recommend this (delegation should usually be preferred to
> inheritance, especially in this case where you would extend classes from
> an external library).
> 
> -- Andreas
> 
> -- 
> Andreas Hartmann, CTO
> BeCompany GmbH
> http://www.becompany.ch
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>