Camel JCR examples?

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel JCR examples?

hardikdesai81
Hi All,

I have a need to use Camel JCR to communicate with a Jackrabbit repository for 3 operations: fetch a particular file, update a particular file, get a list of files in a particular node.

Can someone please provide me some examples that can help in achieving this?

Camel website does not contain sufficient examples.

Thanks & Regards,
Hardik
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

bibryam
I have a blog post and github example here
http://www.ofbizian.com/search/label/JCR

Also you might consider using CMIS component that can talk also to
Jackrabbit. Here is another example using cmis
http://www.ofbizian.com/2012/07/content-migration-with-camel-cmis.html

Cheers,



On 23 January 2014 15:47, hardikdesai81 <[hidden email]> wrote:

> Hi All,
>
> I have a need to use Camel JCR to communicate with a Jackrabbit repository
> for 3 operations: fetch a particular file, update a particular file, get a
> list of files in a particular node.
>
> Can someone please provide me some examples that can help in achieving
> this?
>
> Camel website does not contain sufficient examples.
>
> Thanks & Regards,
> Hardik
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Bilgin Ibryam

Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam <https://twitter.com/bibryam>

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

hardikdesai81
Appreciate a lot Bilgin! I would give both of these examples a try.

One more questions: Is it possible to retrieve all versions of a file using Camel from Jackrabbit?
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

bibryam
I cannot remember that from top of my head, you have to see what is the
JCR/CMIS command for that and see whether it is supported by Camel.

Cheers,




On 24 January 2014 13:05, hardikdesai81 <[hidden email]> wrote:

> Appreciate a lot Bilgin! I would give both of these examples a try.
>
> One more questions: Is it possible to retrieve all versions of a file using
> Camel from Jackrabbit?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5746446.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Bilgin Ibryam

Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam <https://twitter.com/bibryam>

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

hardikdesai81
Ok. Will try further and keep you posted. Thanks for your help so far.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

vivekrao001
Did you get any working example? If so could you please post the solution. Appreciate you help.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

hardikdesai81
Unfortunately not. I eventually ended up implemented JCR API without using Camel, because of our project's tight deadlines.

Hardik


On Thu, May 29, 2014 at 6:39 AM, vivekrao001 [via Camel] <[hidden email]> wrote:
Did you get any working example? If so could you please post the solution. Appreciate you help.


If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5751679.html
To unsubscribe from Camel JCR examples?, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

Gregor Zurowski-3
In reply to this post by vivekrao001
Hi Vivek:

What are you trying to implement with the camel-jcr component?

Gregor


On Wed, May 28, 2014 at 9:09 PM, vivekrao001 <[hidden email]> wrote:
> Did you get any working example? If so could you please post the solution.
> Appreciate you help.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5751679.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

vivekrao001
Hi,

I'm trying to retrieve the files. I need to write a batch which just retrieves the files at regular intervals.

I'm trying something like this.

 from ("jcr://admin:admin@localhost:8080/jackrabbit-webapp-2.6.0/repository/default/b?recursive=true&noop=true").to("file:\\tmp\\out");

I'm getting
Failed to create route route1: Route(route1)[[From[jcr://admin:admin@localhost:8080/j... because of Failed to resolve endpoint: jcr://admin:admin@localhost:8080/jackrabbit-webapp-2.6.0/repository/default/b?noop=true&recursive=true due to: No JCR repository defined under 'localhost'.

Any help is appreciated thanks.

Thanks,
Vivek.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

Gregor Zurowski-3
Hi Vivek:

You can't use the Jackrabbit application URL in the from() DSL method.
You must register your repository with the Camel registry (using a
registry implementation such as JndiContext or Spring's
ApplicationContextRegistry, see
http://camel.apache.org/registry.html).

I would suggest taking a look at the unit tests that are part of the
JCR component. The createJndiContext() method in the
JcrRouteTestSupport class shows how to properly register a repository
instance with JNDI
(https://github.com/apache/camel/blob/master/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java):

protected Context createJndiContext() throws Exception {
    [...]
    Context context = super.createJndiContext();
    repository = new TransientRepository(CONFIG_FILE, REPO_PATH);
    context.bind("repository", repository);
    return context;
}

It also seems that you are using options that are not supported by the
JCR component (use "deep" instead of "recursive", there is no "noop"
option). A list of available options can be found on the JCR component
documentation page: http://camel.apache.org/jcr.html.

Please let us know if you have any further questions.

Gregor


On Mon, Jun 2, 2014 at 1:43 PM, vivekrao001 <[hidden email]> wrote:

> Hi,
>
> I'm trying to retrieve the files. I need to write a batch which just
> retrieves the files at regular intervals.
>
> I'm trying something like this.
>
>  from
> ("jcr://admin:admin@localhost:8080/jackrabbit-webapp-2.6.0/repository/default/b?recursive=true&noop=true").to("file:\\tmp\\out");
>
> I'm getting
> Failed to create route route1:
> Route(route1)[[From[jcr://admin:admin@localhost:8080/j... because of Failed
> to resolve endpoint:
> jcr://admin:admin@localhost:8080/jackrabbit-webapp-2.6.0/repository/default/b?noop=true&recursive=true
> due to: No JCR repository defined under 'localhost'.
>
> Any help is appreciated thanks.
>
> Thanks,
> Vivek.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5751830.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

vivekrao001
Hi,

Thanks for the quick reply,

I was able to create repository in spring config. but was not able to copy the file from repository to local file. could you please look at the below code.

------
 <bean id="repository" class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
         <constructor-arg value="http://localhost:8080/jackrabbit-webapp-2.6.0/repository"/>
    </bean>

----

 ApplicationContext Appcontext = new ClassPathXmlApplicationContext("springContext.xml");  
 CamelContext context = SpringCamelContext.springCamelContext(Appcontext);  
    context.addRoutes(new RouteBuilder()
      {
      public void configure()
        {
        // Set up the route — from the intput directory, to
        //  the output directory, with no other processing
     
     from ("file:jcr://admin:admin@repository/default/b").to("file:\\tmp\\out");
        }
      });
    //
    // Start the Camel route
    context.start();
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

Gregor Zurowski-3
Hi Vivek:

I am not sure what you mean by copying files from the repository to a
local file. JCR repositories are structured into nodes and properties.
Files can be represented as nodes of type nt:file with a jcr:content
child node that holds the contents of the file, if that is what you
mean?

The camel-jcr consumer implements an event listener and returns a list
of javax.jcr.observation.Event instances (see the "Consumer" section
on the documentation page http://camel.apache.org/jcr.html). Please
take a look at the following unit test that shows how the consumer
implementation works:

https://github.com/apache/camel/blob/master/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrConsumerTest.java

To implement your use case you would probably need some query
functionality, but the current implementation of the camel-jcr
producer only supports the creation of new nodes and queries of
individual nodes by ID.

As an alternative approach, you could mount the repository as a WebDAV
share (see http://jackrabbit.apache.org/standalone-server.html#StandaloneServer-WebDAVaccess)
and simply use the File component for copying files.

Gregor

On Mon, Jun 2, 2014 at 4:26 PM, vivekrao001 <[hidden email]> wrote:

> Hi,
>
> Thanks for the quick reply,
>
> I was able to create repository in spring config. but was not able to copy
> the file from repository to local file. could you please look at the below
> code.
>
> ------
>  <bean id="repository"
> class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
>          <constructor-arg
> value="http://localhost:8080/jackrabbit-webapp-2.6.0/repository"/>
>     </bean>
>
> ----
>
>  ApplicationContext Appcontext = new
> ClassPathXmlApplicationContext("springContext.xml");
>  CamelContext context = SpringCamelContext.springCamelContext(Appcontext);
>     context.addRoutes(new RouteBuilder()
>       {
>       public void configure()
>         {
>         // Set up the route — from the intput directory, to
>         //  the output directory, with no other processing
>
>           from
> ("file:jcr://admin:admin@repository/default/b").to("file:\\tmp\\out");
>         }
>       });
>     //
>     // Start the Camel route
>     context.start();
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5751837.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

vivekrao001
Hi Gregor,

I'm trying to copy all the files (nt:file) under a node. And i'm not waiting for lsiterner to listen. I need to copy all the files when ever needed.

I couldn't get the exact syntax anywhere. It would be great help, if you give me some direction.

I'm trying with the following syntax to get a jpeg file

---
 <bean id="repository" class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
         <constructor-arg value="http://localhost:8080/jackrabbit-webapp-2.6.0/rmi"/>
    </bean>
-----
ApplicationContext Appcontext = new ClassPathXmlApplicationContext("springContext.xml");  
 CamelContext context = SpringCamelContext.springCamelContext(Appcontext);
    context.addRoutes(new RouteBuilder()
      {
      public void configure()
        {
        // Set up the route — from the intput directory, to
       
   
    from ("jcr://admin:admin@repository/default/b").setHeader(JcrConstants.JCR_OPERATION, constant(JcrConstants.JCR_GET_BY_ID))
    .setBody(constant("modeshape_logo.jpg")).to("stream:out");
               
    //from ("jcr://admin:admin@repository/default/b").setHeader(JcrConstants.JCR_OPERATION, constant(JcrConstants.JCR_GET_BY_ID))
    //.setBody(constant("modeshape_logo.jpg")).to("file:\\tmp\\out");
   
        }
      });
    //
    // Start the Camel route
    context.start();
----
with Node path : /b/b
and properties :
{
        "jcr:createdBy" : "admin",
        "jcr:created" : "2014-06-02T16:50:07.770-05:00",
        "jcr:primaryType" : "nt:folder",
        "modeshape_logo.jpg" : {
                "jcr:createdBy" : "admin",
                "jcr:created" : "2014-06-02T16:50:07.772-05:00",
                "jcr:primaryType" : "nt:file",
                "jcr:content" : {
                        "jcr:lastModifiedBy" : "admin",
                        "jcr:uuid" : "1eac10e8-f245-4148-bc90-9a01727adba0",
                        "jcr:lastModified" : "2014-06-02T16:50:07.773-05:00",
                        "jcr:primaryType" : "nt:resource"
                }
        }
}

-------

Thanks,
Vivek.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

Gregor Zurowski-3
Hi Vivek:

>         from
> ("jcr://admin:admin@repository/default/b").setHeader(JcrConstants.JCR_OPERATION,
> constant(JcrConstants.JCR_GET_BY_ID))
>         .setBody(constant("modeshape_logo.jpg")).to("stream:out");

As described in my previous post, the current camel-jcr consumer
implements an event listener. Therefore, you cannot use the consumer
(as in your "from" DSL method) to query the repository for specific
nodes. Although the producer supports this using the CamelJcrGetById
operation, it expects node identifiers (UUIDs) instead of node names
(see http://camel.apache.org/jcr.html).

To implement your use case, you would probably need some query
functionality that currently does not exist in camel-jcr. Please feel
free to log a JIRA ticket to request this for a future Camel release.

In the meantime, you could mount the Jackrabbit repository as a WebDAV
share and treat it like a regular path in your local file system. Then
you could use the File2 component
(https://camel.apache.org/file2.html) to copy files from the WebDAV
share to another path. To mount the repository using Linux, you can
use the following command (note that you must have the davfs2 package
installed):

$ sudo mount -t davfs http://localhost:8080/repository/default /target/path

Please let us know if you have any further questions.

Gregor


On Tue, Jun 3, 2014 at 11:26 AM, vivekrao001 <[hidden email]> wrote:

> Hi Gregor,
>
> I'm trying to copy all the files (nt:file) under a node. And i'm not waiting
> for lsiterner to listen. I need to copy all the files when ever needed.
>
> I couldn't get the exact syntax anywhere. It would be great help, if you
> give me some direction.
>
> I'm trying with the following syntax to get a jpeg file
>
> ---
>  <bean id="repository"
> class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
>          <constructor-arg
> value="http://localhost:8080/jackrabbit-webapp-2.6.0/rmi"/>
>     </bean>
> -----
> ApplicationContext Appcontext = new
> ClassPathXmlApplicationContext("springContext.xml");
>  CamelContext context = SpringCamelContext.springCamelContext(Appcontext);
>     context.addRoutes(new RouteBuilder()
>       {
>       public void configure()
>         {
>         // Set up the route — from the intput directory, to
>
>
>         from
> ("jcr://admin:admin@repository/default/b").setHeader(JcrConstants.JCR_OPERATION,
> constant(JcrConstants.JCR_GET_BY_ID))
>         .setBody(constant("modeshape_logo.jpg")).to("stream:out");
>
>          //from
> ("jcr://admin:admin@repository/default/b").setHeader(JcrConstants.JCR_OPERATION,
> constant(JcrConstants.JCR_GET_BY_ID))
>         //.setBody(constant("modeshape_logo.jpg")).to("file:\\tmp\\out");
>
>         }
>       });
>     //
>     // Start the Camel route
>     context.start();
> ----
> with Node path : /b/b
> and properties :
> {
>         "jcr:createdBy" : "admin",
>         "jcr:created" : "2014-06-02T16:50:07.770-05:00",
>         "jcr:primaryType" : "nt:folder",
>         "modeshape_logo.jpg" : {
>                 "jcr:createdBy" : "admin",
>                 "jcr:created" : "2014-06-02T16:50:07.772-05:00",
>                 "jcr:primaryType" : "nt:file",
>                 "jcr:content" : {
>                         "jcr:lastModifiedBy" : "admin",
>                         "jcr:uuid" : "1eac10e8-f245-4148-bc90-9a01727adba0",
>                         "jcr:lastModified" : "2014-06-02T16:50:07.773-05:00",
>                         "jcr:primaryType" : "nt:resource"
>                 }
>         }
> }
>
> -------
>
> Thanks,
> Vivek.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406p5751848.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

dev parker
Hi Gregor & team camel-jcr,

on a related note, do you have a pointer for resolving a jcr via webdav?

I am working with the camel-jcr component to connect to CQ5 (Jackrabbit)
instance. It promises to be useful...

I suspect my JNDI / JCR Repository definition is wrong or incomplete but I
have not better guidance.

May I ask you to provide a pointer to guide me toward a successful
camel-jcr / jackrabbit connection.

I am struggling with camel access via webdav.

I use an XML DSL and the bean registry attempts below.

POM
....
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-core</artifactId>
      <version>2.10.1</version>
    </dependency>
     <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-script</artifactId>
<version>${camel.alt-version}</version>
    </dependency>
     <dependency>
      <groupId>org.beanshell</groupId>
      <artifactId>bsh</artifactId>
      <version>2.0b5</version>
    </dependency>


     <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr-rmi</artifactId>
      <version>2.10.1</version>
    </dependency>

<dependency>    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>jackrabbit-jcr2dav</artifactId>
      <version>2.10.1</version>
</dependency>
<dependency>
    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>jackrabbit-webdav</artifactId>
      <version>2.10.1</version>
</dependency>

..
  <route id="send-data-to-jcr"> <from
uri="file:src/data?antInclude=*.csv&amp;noop=true&amp;delay=500"/>

<setHeader
headerName="jcr:primaryType"><constant>nt:unstructured</constant</setHeader>
<setProperty
propertyName="JcrConstants.JCR_NODE_NAME"><constant>bar</constant></setProperty>
<setProperty
propertyName="my.contents.property"><simple>${body}</simple></setProperty>
<to uri="jcr://admin:admin@LOCALJCR/var/test" />

    </route>
...

-- AND these bean registry attempts --
<bean id="repository"
class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
    <constructor-arg value="rmi://localhost:1099/crx" />
</bean>

-- OR --

<bean id="LOCALJCR"
class="org.apache.jackrabbit.rmi.repository.RMIRemoteRepository">
    <constructor-arg value="rmi://localhost:1099/crx" />
</bean>

-- OR --

<bean id="LOCALJCR"
class="org.apache.jackrabbit.rmi.repository.JNDIRemoteRepository">
<constructor-arg value="jndi://crx?
org.apache.jackrabbit.repository.jndi.name
=crx&amp;java.naming.factory.initial=com.day.util.jndi.provider.MemoryInitialContextFactory&amp;java.naming.provider.url=
http://jcr.day.com" />

-- OR --

<bean id="LOCALJCR"
class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
<constructor-arg value="rmi://localhost:1099"/>


   -
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

Grzegorz Grzybek
Hello

For general camel-jcr usage, see http://camel.apache.org/jcr.html

You can also check examples/tests in Camel's source code:
https://github.com/apache/camel/tree/camel-2.15.2/components/camel-jcr/src/test/java/org/apache/camel/component/jcr

regards
Grzegorz Grzybek

2015-07-16 10:45 GMT+02:00 David Parker <[hidden email]>:

> Hi Gregor & team camel-jcr,
>
> on a related note, do you have a pointer for resolving a jcr via webdav?
>
> I am working with the camel-jcr component to connect to CQ5 (Jackrabbit)
> instance. It promises to be useful...
>
> I suspect my JNDI / JCR Repository definition is wrong or incomplete but I
> have not better guidance.
>
> May I ask you to provide a pointer to guide me toward a successful
> camel-jcr / jackrabbit connection.
>
> I am struggling with camel access via webdav.
>
> I use an XML DSL and the bean registry attempts below.
>
> POM
> ....
>     <dependency>
>       <groupId>org.apache.jackrabbit</groupId>
>       <artifactId>jackrabbit-core</artifactId>
>       <version>2.10.1</version>
>     </dependency>
>      <dependency>
>       <groupId>org.apache.camel</groupId>
>       <artifactId>camel-script</artifactId>
> <version>${camel.alt-version}</version>
>     </dependency>
>      <dependency>
>       <groupId>org.beanshell</groupId>
>       <artifactId>bsh</artifactId>
>       <version>2.0b5</version>
>     </dependency>
>
>
>      <dependency>
>       <groupId>org.apache.jackrabbit</groupId>
>       <artifactId>jackrabbit-jcr-rmi</artifactId>
>       <version>2.10.1</version>
>     </dependency>
>
> <dependency>    <groupId>org.apache.jackrabbit</groupId>
>     <artifactId>jackrabbit-jcr2dav</artifactId>
>       <version>2.10.1</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.jackrabbit</groupId>
>     <artifactId>jackrabbit-webdav</artifactId>
>       <version>2.10.1</version>
> </dependency>
>
> ..
>   <route id="send-data-to-jcr"> <from
> uri="file:src/data?antInclude=*.csv&amp;noop=true&amp;delay=500"/>
>
> <setHeader
>
> headerName="jcr:primaryType"><constant>nt:unstructured</constant</setHeader>
> <setProperty
>
> propertyName="JcrConstants.JCR_NODE_NAME"><constant>bar</constant></setProperty>
> <setProperty
> propertyName="my.contents.property"><simple>${body}</simple></setProperty>
> <to uri="jcr://admin:admin@LOCALJCR/var/test" />
>
>     </route>
> ...
>
> -- AND these bean registry attempts --
> <bean id="repository"
> class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
>     <constructor-arg value="rmi://localhost:1099/crx" />
> </bean>
>
> -- OR --
>
> <bean id="LOCALJCR"
> class="org.apache.jackrabbit.rmi.repository.RMIRemoteRepository">
>     <constructor-arg value="rmi://localhost:1099/crx" />
> </bean>
>
> -- OR --
>
> <bean id="LOCALJCR"
> class="org.apache.jackrabbit.rmi.repository.JNDIRemoteRepository">
> <constructor-arg value="jndi://crx?
> org.apache.jackrabbit.repository.jndi.name
>
> =crx&amp;java.naming.factory.initial=com.day.util.jndi.provider.MemoryInitialContextFactory&amp;java.naming.provider.url=
> http://jcr.day.com" />
>
> -- OR --
>
> <bean id="LOCALJCR"
> class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
> <constructor-arg value="rmi://localhost:1099"/>
>
>
>    -
>
Reply | Threaded
Open this post in threaded view
|

Re: Camel JCR examples?

dev parker
Yes, thanks - I saw this
https://github.com/apache/camel/blob/camel-2.15.2/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
and this,
https://github.com/apache/camel/blob/camel-2.15.2/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java

My effort so far has been to create a webdav-flavor repository reference
using xml dsl. I guess I should extract the test code and refactor a
non-transient repo from that.

I imagine the webdav solution should look something like this - but with
more webdav / javax.jcr.RepositoryFactory flavor
<bean
id="LOCALJCR" class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
         <constructor-arg
value="http://localhost:4502/crx/server"/>
    </bean>

On Thu, Jul 16, 2015 at 2:01 AM, Grzegorz Grzybek <[hidden email]>
wrote:

> Hello
>
> For general camel-jcr usage, see http://camel.apache.org/jcr.html
>
> You can also check examples/tests in Camel's source code:
>
> https://github.com/apache/camel/tree/camel-2.15.2/components/camel-jcr/src/test/java/org/apache/camel/component/jcr
>
> regards
> Grzegorz Grzybek
>
> 2015-07-16 10:45 GMT+02:00 David Parker <[hidden email]>:
>
> > Hi Gregor & team camel-jcr,
> >
> > on a related note, do you have a pointer for resolving a jcr via webdav?
> >
> > I am working with the camel-jcr component to connect to CQ5 (Jackrabbit)
> > instance. It promises to be useful...
> >
> > I suspect my JNDI / JCR Repository definition is wrong or incomplete but
> I
> > have not better guidance.
> >
> > May I ask you to provide a pointer to guide me toward a successful
> > camel-jcr / jackrabbit connection.
> >
> > I am struggling with camel access via webdav.
> >
> > I use an XML DSL and the bean registry attempts below.
> >
> > POM
> > ....
> >     <dependency>
> >       <groupId>org.apache.jackrabbit</groupId>
> >       <artifactId>jackrabbit-core</artifactId>
> >       <version>2.10.1</version>
> >     </dependency>
> >      <dependency>
> >       <groupId>org.apache.camel</groupId>
> >       <artifactId>camel-script</artifactId>
> > <version>${camel.alt-version}</version>
> >     </dependency>
> >      <dependency>
> >       <groupId>org.beanshell</groupId>
> >       <artifactId>bsh</artifactId>
> >       <version>2.0b5</version>
> >     </dependency>
> >
> >
> >      <dependency>
> >       <groupId>org.apache.jackrabbit</groupId>
> >       <artifactId>jackrabbit-jcr-rmi</artifactId>
> >       <version>2.10.1</version>
> >     </dependency>
> >
> > <dependency>    <groupId>org.apache.jackrabbit</groupId>
> >     <artifactId>jackrabbit-jcr2dav</artifactId>
> >       <version>2.10.1</version>
> > </dependency>
> > <dependency>
> >     <groupId>org.apache.jackrabbit</groupId>
> >     <artifactId>jackrabbit-webdav</artifactId>
> >       <version>2.10.1</version>
> > </dependency>
> >
> > ..
> >   <route id="send-data-to-jcr"> <from
> > uri="file:src/data?antInclude=*.csv&amp;noop=true&amp;delay=500"/>
> >
> > <setHeader
> >
> >
> headerName="jcr:primaryType"><constant>nt:unstructured</constant</setHeader>
> > <setProperty
> >
> >
> propertyName="JcrConstants.JCR_NODE_NAME"><constant>bar</constant></setProperty>
> > <setProperty
> >
> propertyName="my.contents.property"><simple>${body}</simple></setProperty>
> > <to uri="jcr://admin:admin@LOCALJCR/var/test" />
> >
> >     </route>
> > ...
> >
> > -- AND these bean registry attempts --
> > <bean id="repository"
> > class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
> >     <constructor-arg value="rmi://localhost:1099/crx" />
> > </bean>
> >
> > -- OR --
> >
> > <bean id="LOCALJCR"
> > class="org.apache.jackrabbit.rmi.repository.RMIRemoteRepository">
> >     <constructor-arg value="rmi://localhost:1099/crx" />
> > </bean>
> >
> > -- OR --
> >
> > <bean id="LOCALJCR"
> > class="org.apache.jackrabbit.rmi.repository.JNDIRemoteRepository">
> > <constructor-arg value="jndi://crx?
> > org.apache.jackrabbit.repository.jndi.name
> >
> >
> =crx&amp;java.naming.factory.initial=com.day.util.jndi.provider.MemoryInitialContextFactory&amp;java.naming.provider.url=
> > http://jcr.day.com" />
> >
> > -- OR --
> >
> > <bean id="LOCALJCR"
> > class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
> > <constructor-arg value="rmi://localhost:1099"/>
> >
> >
> >    -
> >
>