jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Strasser <tobias.stras...@gmail.com>
Subject Re: webdav configuration api
Date Thu, 07 Apr 2005 15:27:32 GMT
hi brian,
sorry for my late response....
a configuration for the server does make sense. but especially the
saving and loading
of resources could be configured more sophistically.

i suggest to introduce some sort of resource importer and exporter
that handle the
specific import/export into/from jcr. for example a: PlainFileImporter
just stores
the file as binary property, whereas a XmlImporter can store it as
deserialized xml.
additional parameters can 'configure' the importers (eg: make node
versionable, etc.)

the importers and exporters are regitered and asked sequencly, if they
want to handle
a specific Webdav Resource/JCR Item:

boolean ResourceImporter.canImport(DavResource, Node parent);
boolean ResourceImporter.import(DavResource, InputStream in, Node parent);

boolean ResourceExporter.canExport(DavResource resource, Node node);
NodeResource ResourceExporter.export(DavResource resource, Node node);

for simplicity we can add a .properties file for configuring the server:

org.apache.jackrabbit.server.importer.0 =

org.apache.jackrabbit.server.importer.1 =
org.apache.jackrabbit.server.PlainFileImporter.makeVersionable = true;

org.apache.jackrabbit.server.exporter.0 =
org.apache.jackrabbit.server.exporter.1 =

and so on...
what do you think?

cheers, tobi

On Apr 6, 2005 10:08 PM, Brian Moseley <bcm@osafoundation.org> wrote:
> it's pretty clear that we need a way to pass configuration info between
> the various webdav components. here are a few examples where config info
> is needed:
> 1) DavResourceImpl:319 - toggle makeVersionable flag on or off
> 2) DavResourceImpl:333 - toggle xml import on or off
> 3) NodeResource:74 - toggle dir listings on or off; generate dir listing
> ourself or set the node as a request attribute and forward somewhere else
> what would be the right way to pass config info?
> my first instinct is to create a DavConfig interface within the servlet
> and pass instances of it to the other objects as they're constructed.
> the config info could be specified in servlet init params or a
> properties file or even other mechanisms, each managed by a DavConfig
> implementation.
> are there any alternate proposals? does anybody object to me working up
> a patch for this?

------------------------------------------< tobias.strasser@day.com >---
Tobias Strasser, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97 
-----------------------------------------------< http://www.day.com >---

View raw message