Andreas Hartmann wrote:
Hi Cocoon devs,
I'm currently examining the JCR block (thanks, Sylvain, Michi and all
others
who were involved!)
Some questions:
1) IIUC, every time a source is resolved a new JCR session is created.
Does this mean that no transactions can be used?
Maybe it would make sense to attach the JCR session to the Cocoon
session, so that all resolved JCRNodeSources save their data to a
single session which would allow them to take part in a single
transaction?
Yes it makes sense! As Cedric said this stuff is fairly new, and
currently the session management is definitely suboptimal and doesn't
allow for transaction management.
Now what should be the scope of the session? I'm not sure there is a
single answer to this and the plan was to allow to configure the
Repostory object with input/output modules that whould be used to
get/store the session. Such modules would typically store the JCR
session in a request attribute or in a servlet session attribute.
And this leads to yet another problem: calling session.logout(), which
happens at different times depending on the session scope...
The solution (thinking as a type) can be to have some kind of
JCRSessionPolicy object that would take care of getting/storing/closing
the session.
For now, you can simply override the login() method to manage the session!
2) How about storing additional custom properties (e.g., meta data)
in the node which is represented by the source?
Could be done by having JCRSource implementing InspectableSource (in the
repository block)
3) How about locking and versioning?
LockableSource in the repository block :-)
There's also a VersionableSource there, but it somehow competes with the
VersionedSource I wrote for the CVSSource [1].
I read a comment by Ugo Cei that it would make sense to drop the Cocoon
Repository block in favor of the JCR block. Does that mean that the
JCRNodeSource would be extended to provide access to JCR functionality?
I'm not sure this is a good idea. The repository block defines some
Source extensions that can be used by source implementations that wrap a
repository (JCR, webdav, etc).
Sorry if these questions have been answered before, I didn't find
anything
on this list.
Well, there hasn't been much discussion about this :-)
Sylvain, hacking with Bertrand and Daniel at the ApacheCon :-)
--
Sylvain Wallez Anyware Technologies
http://apache.org/~sylvain http://anyware-tech.com
Apache Software Foundation Member Research & Technology Director