You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Tony Rozga <to...@neovalent.com> on 2008/12/18 00:14:42 UTC
Bridging DataStore and Web
I'm wondering if anyone has thought about a direct bridge between a web server and a FileDataStore? It seems like the only things missing to implement such a thing are file extensions in the data store and a way to compute a filesystem path for an item in the FileDataStore.
It could be modeled as a cache interface:
interface BlobFileSystemCache {
/**
* Returns path to a file in filesystem containing blob.
**/
String getPathToBlob(Node nodeWithJcrDataProperty);
// other ways to get path?
}
class FileDataStoreFileSystemCache implements BlobFileSystemCache would be really easy to implement as the files already exist in the filesystem. Other implementations could be made over database-backed DataStores. These would actually perform true caching functionality and could implement various policies pertaining to caching (lifetime, etc).
Tony Rozga
Re: Bridging DataStore and Web
Posted by Thomas Müller <th...@day.com>.
Hi,
I'm wondering if anyone has thought about a direct bridge between a web
> server and a FileDataStore?
You may be interested in https://issues.apache.org/jira/browse/JCR-1892
> It seems like the only things missing to implement such a thing are file
> extensions in the data store
The same binary object could be stored in multiple places (nodes) and thus
have multiple file names and extensions. I believe file name and extension
are attributes (that may change) and should not be bound to the content.
> and a way to compute a filesystem path for an item in the FileDataStore.
In some cases (DbDataStore) there is no path, and in some implementations it
may not be stable.
These would actually perform true caching functionality and could implement
> various policies pertaining to caching (lifetime, etc).
JCR-1892 should allow you to implement something like the HTTP ETag feature
- http://en.wikipedia.org/wiki/HTTP_ETag - if this is what you need.
Regards,
Thomas
Re: Bridging DataStore and Web
Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Dec 18, 2008 at 12:14 AM, Tony Rozga <to...@neovalent.com> wrote:
> I'm wondering if anyone has thought about a direct bridge between a web
> server and a FileDataStore?
I would strongly recommend to go through JCR. The simplest way for a
pure file-based mapping is to use WebDAV (the SimpleWebDAVServlet
which exposes nt:files and nt:folders), another way is to use Apache
Sling for a HTTP layer on top of JCR.
The DataStore is an implementation detail of Jackrabbit and thus not
standards-compliant - if you'd like to switch the underlying
repository implementation, you would be stuck. Also what you want to
do - get datastore id by path - is already implemented in Jackrabbit,
you would simply re-invent the wheel, especially with a new API. See
also this recent thread: http://markmail.org/message/ksahr7mluzt7ibsw
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com