You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Guo Zhenhua <je...@gmail.com> on 2009/12/11 08:29:14 UTC
client configuration for jcr2spi + spi2dav
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
Re: client configuration for jcr2spi + spi2dav
Posted by Guo Zhenhua <je...@gmail.com>.
For the BatchReadConfig, if I want to retrieve only the node I
specify, method "getDepth" should return 0 or 1?
Gerald
On Fri, Dec 11, 2009 at 4:44 AM, Stefan Guggisberg
<st...@gmail.com> wrote:
> 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 <je...@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
>>
>
Re: client configuration for jcr2spi + spi2dav
Posted by Stefan Guggisberg <st...@gmail.com>.
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 <je...@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
>
Re: client configuration for jcr2spi + spi2dav
Posted by Guo Du <mr...@gmail.com>.
On Fri, Dec 11, 2009 at 4:58 PM, Guo Zhenhua <je...@gmail.com> wrote:
> Thanks. I am considering whether to use JackRabbit 2 because it is
> still beta. Probably I will go with JackRabbit 1.6.0 at first.
JR 2.0 could be released in next a few months. If your project doesn't
expect to release before that, it's better to stay with 2.0 for long
term investment. It's quit big changes between 1 and 2 :)
-Guo
Re: client configuration for jcr2spi + spi2dav
Posted by Guo Zhenhua <je...@gmail.com>.
Thanks. I am considering whether to use JackRabbit 2 because it is
still beta. Probably I will go with JackRabbit 1.6.0 at first.
Gerald
On Fri, Dec 11, 2009 at 6:18 AM, Michael Dürig <mi...@day.com> wrote:
>
> Guo Zhenhua 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
>
>
> On Jackrabbit 2 there are factories for doing this:
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/Spi2davRepositoryServiceFactory.java
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/Spi2davexRepositoryServiceFactory.java
>
>
> Michael
>
>
>
Re: client configuration for jcr2spi + spi2dav
Posted by Michael Dürig <mi...@day.com>.
Guo Zhenhua 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
On Jackrabbit 2 there are factories for doing this:
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/Spi2davRepositoryServiceFactory.java
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/Spi2davexRepositoryServiceFactory.java
Michael
Re: client configuration for jcr2spi + spi2dav
Posted by Kenneth Yue <Ke...@Sun.COM>.
Alexander Klimetschek wrote:
> On Fri, Dec 11, 2009 at 08:29, Guo Zhenhua <je...@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
>
> See also my earlier post: http://markmail.org/message/nzcbrf27b2edkbzr
Is there an easier, non-java way to configure it, like the examples in
http://jackrabbit.apache.org/repository-server-howto.html?
Thanks.
Ken
Re: client configuration for jcr2spi + spi2dav
Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Dec 11, 2009 at 08:29, Guo Zhenhua <je...@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
See also my earlier post: http://markmail.org/message/nzcbrf27b2edkbzr
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com