You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Techie Technical <de...@gmail.com> on 2017/01/25 09:07:29 UTC

Retrieving Oak Repository object during tomcat deployment

In My Enterprise Application (Java – 1.8 , Spring, Oak – 1.4.1 , MongoDB
Server – 3.2 ) to get Repository handle,

<raw>Jcr jcr = new Jcr(new Oak(MongoUtils.getDocumentNodeStore()))
.with(getSecurityProvider())
.withAsyncIndexing()
.with(new LuceneIndexEditorProvider())
.with((QueryIndexProvider) provider)
.with((Observer) provider)
.withAsyncIndexing();</raw>
logger.info("Acquired MongoDB datastore for Jackrabbit Oak; About to
create/get repository");

Repository repository = jcr.createRepository();

Every time on Tomcat restart, do I need to call ‘jcr.createRepository()’?

Earlier we had Jackrabbit 2.8 version, wherein repository.xml had the
configuration and now with Oak I have no clue on getting repository other
than createRepository().

Re: Retrieving Oak Repository object during tomcat deployment

Posted by Techie Technical <de...@gmail.com>.
Can we have a small reference on web application with MongoDB as Node Store?

On Wed, Jan 25, 2017 at 1:07 PM, Techie Technical <
developer.spring@gmail.com> wrote:

> In My Enterprise Application (Java – 1.8 , Spring, Oak – 1.4.1 , MongoDB
> Server – 3.2 ) to get Repository handle,
>
> <raw>Jcr jcr = new Jcr(new Oak(MongoUtils.getDocumentNodeStore()))
> .with(getSecurityProvider())
> .withAsyncIndexing()
> .with(new LuceneIndexEditorProvider())
> .with((QueryIndexProvider) provider)
> .with((Observer) provider)
> .withAsyncIndexing();</raw>
> logger.info("Acquired MongoDB datastore for Jackrabbit Oak; About to
> create/get repository");
>
> Repository repository = jcr.createRepository();
>
> Every time on Tomcat restart, do I need to call ‘jcr.createRepository()’?
>
> Earlier we had Jackrabbit 2.8 version, wherein repository.xml had the
> configuration and now with Oak I have no clue on getting repository other
> than createRepository().
>
>
>

Re: Retrieving Oak Repository object during tomcat deployment

Posted by Chetan Mehrotra <ch...@gmail.com>.
Have a look at webapp example at
https://github.com/apache/jackrabbit-oak/tree/trunk/oak-examples/webapp
Chetan Mehrotra


On Wed, Jan 25, 2017 at 2:37 PM, Techie Technical
<de...@gmail.com> wrote:
> In My Enterprise Application (Java – 1.8 , Spring, Oak – 1.4.1 , MongoDB
> Server – 3.2 ) to get Repository handle,
>
> <raw>Jcr jcr = new Jcr(new Oak(MongoUtils.getDocumentNodeStore()))
> .with(getSecurityProvider())
> .withAsyncIndexing()
> .with(new LuceneIndexEditorProvider())
> .with((QueryIndexProvider) provider)
> .with((Observer) provider)
> .withAsyncIndexing();</raw>
> logger.info("Acquired MongoDB datastore for Jackrabbit Oak; About to
> create/get repository");
>
> Repository repository = jcr.createRepository();
>
> Every time on Tomcat restart, do I need to call ‘jcr.createRepository()’?
>
> Earlier we had Jackrabbit 2.8 version, wherein repository.xml had the
> configuration and now with Oak I have no clue on getting repository other
> than createRepository().