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 <[email protected]> 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
>