jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: client configuration for jcr2spi + spi2dav
Date Fri, 11 Dec 2009 09:44:02 GMT
hi gerald

here's an (incomplete) code sample, but you'll hopefully get the idea:

<code>
[...]
import javax.jcr.Repository;
import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
import org.apache.jackrabbit.spi2davex.BatchReadConfig;
import org.apache.jackrabbit.spi2davex.RepositoryServiceImpl;
[...]
    public Repository getRepository() throws RepositoryException {
        BatchReadConfig batchReadConfig = new BatchReadConfig() {
            public int getDepth(Path path, PathResolver resolver)
                    throws NamespaceException {
                return batchReadDepth;
            }
        };
        final RepositoryServiceImpl srvc = new
RepositoryServiceImpl(uri, defaultWorkspaceName, batchReadConfig);
        RepositoryConfig repConfig = new RepositoryConfig() {
            public CacheBehaviour getCacheBehaviour() {
                return cacheBehaviour;
            }
            public int getItemCacheSize() {
                return itemCacheSize;
            }
            public int getPollTimeout() {
                return pollTimeout;
            }
            public RepositoryService getRepositoryService()
                    throws RepositoryException {
                return srvc;
            }
        };
        return RepositoryImpl.create(repConfig);
    }
</code>

cheers
stefan


On Fri, Dec 11, 2009 at 8:29 AM, Guo Zhenhua <jenvor@gmail.com> wrote:
> I want to use jcr2spi + spi2dav as client. However, I could not find
> how to configure them. For example
> 1) How to tell spi to use spi2dav implementation
> 2) how to spi2dav the location of the server
>
> Thanks
> Gerald
>

Mime
View raw message