You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Wechner <mi...@wyona.com> on 2005/08/09 13:26:00 UTC

Co-existence of JCR and Lenya-JCR

Hi

It seems to me that the current implementation/configuration is mixing
the "pure" JCR usage and the Lenya JCR usage, e.g. within cocoon.xconf

<component class="org.apache.lenya.cms.jcr.LenyaRepository" logger="jcr" 
role="javax.jcr.Repository">
....

and

<component-instance 
class="org.apache.lenya.cms.jcr.LenyaJCRSourceFactory" name="jcr">
...

I think the one of the Cocoon block should be able to coexist beside the
Lenya one and not be replaced the Lenya one.


Also I am not sure why this is actually necessary and this needs to me 
mixed at all.

Any idea why it has been implemented this way?

Thanks

Michi

-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>>>
>>>
>>> why do you consider JCR as publet. I would say that should be part of 
>>> the core.
>>
>> -1
>>
>> Lenya still suffers from too many cross-component dependencies.

 > which one do you mean?

- some components access the revision controller directly, which should
   be a concern of the repository service

- the transaction classes are used by various other classes
   (this is still work in progress, I'm doing a small re-design)

- XML handling is done by various components

- the publication API depends on the workflow component and the
   other way round, whereas this dependence has been reduced to a
   minimum in 1.4


>> There should be no dependencies from the core to the JCR-related
>> classes, only the other way round.
> 
> depends if one considers JCR as core functionality

I stated my opinion on this subject quite frequently.
At the moment, I'd strongly discourage spreading JCR references
across the codebase and hard-wiring the JCR integration. This would
only make things more complex and would not do any good.

The question is not if it is core functionality. IMO it is great
to support JCR out of the box. But modularization is a very important
design principle which we cannot neglect. Publets allow to separate
functionality into distinct modules.


>> The JCR publet offers just another
>> implementation of the Lenya repository components.
> 
> ok, but I think it's very confusing, because I don't
> think JCR is a publet neither, or what does publet mean
> to you? Maybe we should clarify this first ;-)

IMO a publet is a module which provide a certain functionality.

This can be for instance a set of resources or a certain
implementation of a service.


-- Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

>>
>>
>> why do you consider JCR as publet. I would say that should be part of 
>> the core.
>
>
> -1
>
> Lenya still suffers from too many cross-component dependencies.


which one do you mean?

> There should be no dependencies from the core to the JCR-related
> classes, only the other way round.


depends if one considers JCR as core functionality

> The JCR publet offers just another
> implementation of the Lenya repository components.


ok, but I think it's very confusing, because I don't
think JCR is a publet neither, or what does publet mean
to you? Maybe we should clarify this first ;-)

Michi

>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>>>>
>>>> That would be possible for instance by using a selector for different
>>>> repositories.
>>>
>>>
>>>
>>> can you give an example
>>
>>
>>
>> cocoon.xconf:
>>
>> <repositories>
>>   <default> ... </default>
>>   <myrepo> ... </myrepo>
>> </repositories>
>>
>> selector = (...) this.manager.lookup(Repository.ROLE + "Selector");
>> repository = (...) selector.select("myrepo");
> 
> 
> 
> ok. And within the sitemap it would look as follows:
> 
> jcr://myrepo/....

Actually this would be up to the source / source factory implementation.
Using the first path step to select the repository is certainly a
possible solution.

JCRSourceFactory.getSource():

String repoName = path.split('/')[0];
Repository repo = (Repository) selector.select(repoName);
session = repo.login();
return createSource(session, path);


>>>> Multiple source factories can be registered anyway
>>>> (using different protocols).
>>>
>>>
>>>
>>> I think it makes sense to register teh Lenya Source Factory with 
>>> another protocol, e.g. jcr-lenya or whatever.
>>
>>
>>
>> OK, we could do that if we use a selector to manage the repository
>> implementations 
> 
> isn't that two different things? I mean the actual repository and
> the actual source factory?

At the moment, there's only one repository:

SourceFactory.lazyInit():

this.repo = (Repository)manager.lookup(Repository.class.getName());

This means that only one Repository service is available.
Of course you can instanciate multiple source factories, but they
will access the same repository.

[...]

>> All JCR related stuff is in the JCR publet.
> 
> ok
> 
>> This way, we can keep
>> it clearly separated from the core.
> 
> 
> why do you consider JCR as publet. I would say that should be part of 
> the core.

-1

Lenya still suffers from too many cross-component dependencies.
There should be no dependencies from the core to the JCR-related
classes, only the other way round. The JCR publet offers just another
implementation of the Lenya repository components.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

>>>
>>> That would be possible for instance by using a selector for different
>>> repositories.
>>
>>
>> can you give an example
>
>
> cocoon.xconf:
>
> <repositories>
>   <default> ... </default>
>   <myrepo> ... </myrepo>
> </repositories>
>
> selector = (...) this.manager.lookup(Repository.ROLE + "Selector");
> repository = (...) selector.select("myrepo");


ok. And within the sitemap it would look as follows:

jcr://myrepo/....

>
>
>>
>>> Multiple source factories can be registered anyway
>>> (using different protocols).
>>
>>
>> I think it makes sense to register teh Lenya Source Factory with 
>> another protocol, e.g. jcr-lenya or whatever.
>
>
> OK, we could do that if we use a selector to manage the repository
> implementations 


isn't that two different things? I mean the actual repository and
the actual source factory?

> or define our own repository service (which
> I wouldn't recommend).
>
>
>> To be honest I am still very confused. Where are these classes 
>> actually, because
>> I cannot find them within src/java and what file does patch the 
>> cocoon.xconf file.
>> I thought this is being done by src/webapp/WEB-INF/cocoon-xconf.xsl, 
>> but it doesn't
>> really contain anything with re to that.
>
>
> All JCR related stuff is in the JCR publet.


ok

> This way, we can keep
> it clearly separated from the core.



why do you consider JCR as publet. I would say that should be part of 
the core.

> (reminder for me: I forgot to
> move the jcr.import usecase to the publet)
>
>
> I'll update the docs "real soon now".
>
> Sorry if the implementation causes confusion, I tried to keep it as
> straightforward as possible and use only Cocoon/Avalon development
> principles.


no problem. It just seems to me that it needs some explanation and 
discussions

>
> BTW - I hope you'll get well soon!


me too ;-)

Thanks

Michi


>
> -- Andreas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Andreas Hartmann wrote:
> 
>> Michael Wechner wrote:
>>
>>> Hi
>>>
>>> It seems to me that the current implementation/configuration is mixing
>>> the "pure" JCR usage and the Lenya JCR usage, e.g. within cocoon.xconf
>>>
>>> <component class="org.apache.lenya.cms.jcr.LenyaRepository" 
>>> logger="jcr" role="javax.jcr.Repository">
>>> ....
>>
>>
>>
>> This is no "mixture". The LenyaRepository is a specialization of the
>> JackrabbitRepository of the JCR block. It attaches the JCR session to the
>> Cocoon session (this will be necessary to use JCR transactions)
> 
> why not implement this into the Cocoon block directly?

Because it's Lenya-specific. The JCR block doesn't make any
presumptions how the JCR session is handled (see discussion on
cocoon-dev).


>> and
>> registers Lenya namespaces and node types.
> 
> 
> 
> are these for the meta-data?

Yes.

> 
>> That's just how OOSD works :)
> 
> ok. But wouldn't it make sense to differentiate the logger, e.g. jcr.lenya
> instead just jcr, in case people use both, I mean the Cocoon JCR repo 
> and the Lenya JCR repo?

Yes, that would certainly make sense.


>>> <component-instance 
>>> class="org.apache.lenya.cms.jcr.LenyaJCRSourceFactory" name="jcr">
>>> ...
>>
>>
>>
>> The LenyaJCRSourceFactory adds the Lenya mixin nodetype to new
>> repository nodes.
> 
> what's the reason for that?

Meta data are stored as properties. To support these properties, the
node type has to be declared and attached to the content nodes.


> won't there be problems if people for instance want to reuse existing 
> pipelines which were making use of the Cocoon JCR Factory?

No, the Lenya JCR components only add functionality.


>>> I think the one of the Cocoon block should be able to coexist beside the
>>> Lenya one and not be replaced the Lenya one.
>>
>> That would be possible for instance by using a selector for different
>> repositories.
> 
> can you give an example

cocoon.xconf:

<repositories>
   <default> ... </default>
   <myrepo> ... </myrepo>
</repositories>

selector = (...) this.manager.lookup(Repository.ROLE + "Selector");
repository = (...) selector.select("myrepo");


> 
>> Multiple source factories can be registered anyway
>> (using different protocols).
> 
> I think it makes sense to register teh Lenya Source Factory with another 
> protocol, e.g. jcr-lenya or whatever.

OK, we could do that if we use a selector to manage the repository
implementations or define our own repository service (which
I wouldn't recommend).


> To be honest I am still very confused. Where are these classes actually, 
> because
> I cannot find them within src/java and what file does patch the 
> cocoon.xconf file.
> I thought this is being done by src/webapp/WEB-INF/cocoon-xconf.xsl, but 
> it doesn't
> really contain anything with re to that.

All JCR related stuff is in the JCR publet. This way, we can keep
it clearly separated from the core. (reminder for me: I forgot to
move the jcr.import usecase to the publet)


I'll update the docs "real soon now".

Sorry if the implementation causes confusion, I tried to keep it as
straightforward as possible and use only Cocoon/Avalon development
principles.

BTW - I hope you'll get well soon!

-- Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

> Michael Wechner wrote:
>
>> Hi
>>
>> It seems to me that the current implementation/configuration is mixing
>> the "pure" JCR usage and the Lenya JCR usage, e.g. within cocoon.xconf
>>
>> <component class="org.apache.lenya.cms.jcr.LenyaRepository" 
>> logger="jcr" role="javax.jcr.Repository">
>> ....
>
>
> This is no "mixture". The LenyaRepository is a specialization of the
> JackrabbitRepository of the JCR block. It attaches the JCR session to the
> Cocoon session (this will be necessary to use JCR transactions)


why not implement this into the Cocoon block directly?

> and
> registers Lenya namespaces and node types.


are these for the meta-data?

> That's just how OOSD works :)


ok. But wouldn't it make sense to differentiate the logger, e.g. jcr.lenya
instead just jcr, in case people use both, I mean the Cocoon JCR repo 
and the Lenya JCR repo?

>
>
>> <component-instance 
>> class="org.apache.lenya.cms.jcr.LenyaJCRSourceFactory" name="jcr">
>> ...
>
>
> The LenyaJCRSourceFactory adds the Lenya mixin nodetype to new
> repository nodes.


what's the reason for that?

won't there be problems if people for instance want to reuse existing 
pipelines
which were making use of the Cocoon JCR Factory?

>
>
>> I think the one of the Cocoon block should be able to coexist beside the
>> Lenya one and not be replaced the Lenya one.
>
>
>
> That would be possible for instance by using a selector for different
> repositories.


can you give an example

> Multiple source factories can be registered anyway
> (using different protocols).


I think it makes sense to register teh Lenya Source Factory with another 
protocol, e.g. jcr-lenya or whatever.


To be honest I am still very confused. Where are these classes actually, 
because
I cannot find them within src/java and what file does patch the 
cocoon.xconf file.
I thought this is being done by src/webapp/WEB-INF/cocoon-xconf.xsl, but 
it doesn't
really contain anything with re to that.

Maybe I am confused because of this bad flu I have, but any pointers are 
appreciated.

Michi

>
>
>
>> Also I am not sure why this is actually necessary and this needs to 
>> me mixed at all.
>
>
> See above.
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Co-existence of JCR and Lenya-JCR

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Hi
> 
> It seems to me that the current implementation/configuration is mixing
> the "pure" JCR usage and the Lenya JCR usage, e.g. within cocoon.xconf
> 
> <component class="org.apache.lenya.cms.jcr.LenyaRepository" logger="jcr" 
> role="javax.jcr.Repository">
> ....

This is no "mixture". The LenyaRepository is a specialization of the
JackrabbitRepository of the JCR block. It attaches the JCR session to the
Cocoon session (this will be necessary to use JCR transactions) and
registers Lenya namespaces and node types. That's just how OOSD works :)


> <component-instance 
> class="org.apache.lenya.cms.jcr.LenyaJCRSourceFactory" name="jcr">
> ...

The LenyaJCRSourceFactory adds the Lenya mixin nodetype to new
repository nodes.


> I think the one of the Cocoon block should be able to coexist beside the
> Lenya one and not be replaced the Lenya one.


That would be possible for instance by using a selector for different
repositories. Multiple source factories can be registered anyway
(using different protocols).


> Also I am not sure why this is actually necessary and this needs to me 
> mixed at all.

See above.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org