jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@day.com>
Subject Re: Custom PersistenceManagers - How can I get the path associated with a NodeId?
Date Wed, 25 Jun 2008 12:46:53 GMT
hi jerome

On Mon, Jun 23, 2008 at 8:02 PM, Jerome Banks <jerome.banks@gmail.com> wrote:
> Hey Folks,
>  I'm trying to implement a custom PersistenceManager, and I'm running into
> some difficulties.
>
> I'd like to create a PersistenceManager where Nodes are stored on a
> filesystem, in a Folder corresponding the path of the Node in the
> Repository.  This way we could have nt:file file nodes which are accessible
> by non-JCR clients, simply as files on a filesystem.

this is not supported in jackrabbit and i certainly wouldn't recommend it.
the repository could get easily corrupted.

>
> However, the methods provided to PersistenceManager only seem to pass in
> NodeId or PropertyId, which don't seem to have a path, but simply a UUID.
> It looks like various components in Jackrabbit are able to store items on
> the filesystem, but they do so by chopping up the UUID, and creating their
> own path.  Is there any reason we couldn't just use the Node's path to start
> out with?  From the JCR API perspective, it is alway available when a Node
> or Property is created. Why can't it be accessed by the PersistenceManager?

PersistenceManager is not a SPI, it's a low-level api with a very
simple contract:
a PersistenceMananger basically stores and retrieves an object by id (much like
a hashmap. berkeley db, etc).

>
>  Any hints on how to accomplish my goal?  I want to be able to store items
> (basically binary properties ) on a filesystem, according to their path in
> the repository.

you could
- use webdav to access the 'files'
- implement the jackrabbit SPI (as marcel suggested)
- don't use jackrabbit at all but simply use the file system ;)

cheers
stefan

>
> thx ...
>

Mime
View raw message