Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 26856 invoked from network); 22 Jul 2005 12:21:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jul 2005 12:21:24 -0000 Received: (qmail 56206 invoked by uid 500); 22 Jul 2005 12:21:23 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 55649 invoked by uid 500); 22 Jul 2005 12:21:21 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 55636 invoked by uid 99); 22 Jul 2005 12:21:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 05:21:20 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ap-cocoon-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 05:21:16 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DvwWM-0007l2-Fd for dev@cocoon.apache.org; Fri, 22 Jul 2005 14:20:54 +0200 Received: from gate.wyona.com ([195.226.6.75]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jul 2005 14:20:54 +0200 Received: from andreas by gate.wyona.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jul 2005 14:20:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@cocoon.apache.org From: Andreas Hartmann Subject: Re: [jcr] Scope of JCRNodeSource Date: Fri, 22 Jul 2005 14:20:08 +0200 Lines: 116 Message-ID: References: <42E0CEFF.3020401@anyware-tech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gate.wyona.com User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en In-Reply-To: <42E0CEFF.3020401@anyware-tech.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N C�dric Damioli wrote: > Hi Andreas, > > This block is really in an very early stage of development. > In the actually committed version, it does not work as expected. Yesterday I configured Lenya to use the JCRSourceFactory to generate sources for storing content - it works fine :) Maybe a short introduction: In Lenya, we're planning to support JCR repositories for quite a long time now. But we want to leverage Cocoon components, if available, instead of implementing our own ones. That's why I'm interested in extending the JCR block to our needs. Basically we need the following functionality: - content storage (XML and binary data) - properties (meta data) - locking - versioning - transactions We can't afford to switch to JCR in one step, that's why it would probably help us to have a set of generic repository Source interfaces (like the JCR block), which would be implemented by the JCRNodeSource and by our own sources (using the Lenya revision controller, locking mechanism etc.). That would allow us to support both our existing repository access mechanism and the JCRSourceFactory: - interface o.a.cocoon.RepositorySource (locking, versioning, etc.) - implementation o.a.cocoon.JCRNodeSource - implementation o.a.lenya.LenyaRepositorySource If the JCRNodeSource doesn't implement generic interfaces, we need another layer in Lenya to provide this abstraction: - interface o.a.lenya.LenyaSource (locking, versioning, etc.) - implementation o.a.lenya.LenyaRepoSource - implementation o.a.lenya.LenyaJCRSourceImpl The LenyaJCRSourceImpl would resolve a JCRNodeSource and use its functionality. [...] >> 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? > > > There are many points here : some may wants to attach to the JCR Session > to the Servlet Session, others will want to attach JCR Session to the > Request (as a JDBC Connection, this is my case), others will want to > have one single JCR Session for the entire application. > This IMHO must be a configurable thing. Yes, you're right. Attaching it to the servlet session is just one example. > Other problem is the logout one : when called, the repository.login() > is made by the JCR block classes, but the logout must be made by the > application. But when ? I choose to implement this via Servlet's > RequestListeners or SessionListeners. I'm not familiar with these concepts - would that mean that the logout happens for instance when the session expires? > You may also extend the > CocoonServlet to logout at the end of the service() method. >> 2) How about storing additional custom properties (e.g., meta data) >> in the node which is represented by the source? > > > good point :-) > The JCRNodeSource is actually made for Nodes :-) > This idea was to also have a JCRPropertySource. But it has never been > implemented. I would be very interested in this functionality. >> >> 3) How about locking and versioning? > > > Another good point. > > At the begining of my JCR-related work, I wanted to have > VersionedSource, LockableSource, and then > LockableModifiableTraversableVersionableSource :-p > And I then realized that such business logic things may overrun the goal > of Sources. > So I finally simply get the JCR Node from the JCRNodeSource and directly > play with JCR API in my own business logic classes. I guess we have to use the same approach in Lenya. Maybe it really isn't necessary to mimic the JCR Node functionality in the source layer. > Sylvain and I have actually had different ideas about what a JCRSource > must be. > I personally thought about an entry point to every JCR Item in the > Repository (it appears it is what you want too) Yes, that's what I imagined. > Sylvain thought more about a TraversableSource with directories and > files (actually nt:directory and nt:file Nodes). IIUC that wouldn't allow to leverage JCR features apart from content storage? -- Andreas