Camel-box download file version

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

Camel-box download file version

cherepnalkovski
Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

Andrea Cosentino-2
Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Reply | Threaded
Open this post in threaded view
|

RE: Camel-box download file version

cherepnalkovski
Yes, I tried that too.



I tried two options :

.toD("box://files/downloadVersion?version=1");
Exception : Failed to resolve endpoint: box://files/downloadVersion?version=1 due to: No matching method for files/downloadVersion, with arguments [version]

version id received from “BoxFile.Info” is  374220338428

.toD("box://files/downloadVersion?version=374220338428");

Exception : Failed to resolve endpoint: box://files/downloadVersion?version=374220338428 due to: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Integer with value 374220338428 due For input string: "374220338428"



I this this is some bug. How to open a ticket ?






Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________
From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 21, 2018 2:32:13 PM
To: [hidden email]
Subject: Re: Camel-box download file version

Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

Andrea Cosentino-2
Hello,

You need to raise the JIRA here:

https://issues.apache.org/jira/projects/CAMEL

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 3:13:33 PM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





Yes, I tried that too.



I tried two options :

.toD("box://files/downloadVersion?version=1");
Exception : Failed to resolve endpoint: box://files/downloadVersion?version=1 due to: No matching method for files/downloadVersion, with arguments [version]

version id received from “BoxFile.Info” is  374220338428

.toD("box://files/downloadVersion?version=374220338428");

Exception : Failed to resolve endpoint: box://files/downloadVersion?version=374220338428 due to: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Integer with value 374220338428 due For input string: "374220338428"



I this this is some bug. How to open a ticket ?






Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________

From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 21, 2018 2:32:13 PM
To: [hidden email]
Subject: Re: Camel-box download file version

Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

cherepnalkovski
In reply to this post by cherepnalkovski
I found the issue, and a solution.


First there is a mistake in camel - box documentation.


Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".


If we use full endpoint name downloadPreviousFileVersion, the route will work.


Also, there is a problem in camel - box endpoint mapping.

I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.


Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

Andrea Cosentino-2
You're welcome to work on a PR.

The documentation for this component is here

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





I found the issue, and a solution.


First there is a mistake in camel - box documentation.


Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".


If we use full endpoint name downloadPreviousFileVersion, the route will work.


Also, there is a problem in camel - box endpoint mapping.

I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.


Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

cherepnalkovski

Done. 

 

I hope that someone will change the mapping on backend, so the shorthand alias will be available for use.

 

From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 28, 2018 11:22 AM
To: [hidden email]
Subject: Re: Camel-box download file version

 

You're welcome to work on a PR.

The documentation for this component is here

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc

https://avatars3.githubusercontent.com/u/47359?s=400&v=4

github.com

Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com.The Box application’s client id and secret will allow access to Box APIs which require a current user.




--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:





I found the issue, and a solution.


First there is a mistake in camel - box documentation.


Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".


If we use full endpoint name downloadPreviousFileVersion, the route will work.


Also, there is a problem in camel - box endpoint mapping.

I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.

Reply | Threaded
Open this post in threaded view
|

Re: Camel-box download file version

Andrea Cosentino-2
That class is generated. You just need to change the methodPattern here:

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/pom.xml#L278

If you are fancy opening a PR about that after testing the fix, you're welcome to do it

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:35:48 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:







Done. 

 

I hope that someone will change the mapping on backend, so the shorthand alias will be available for use.

 





From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 28, 2018 11:22 AM
To: [hidden email]
Subject: Re: Camel-box download file version


 





You're welcome to work on a PR.The documentation for this component is herehttps://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc


  



    

camel/box-component.adoc at master · apache/camel · GitHub

  

github.com

  

Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com.The Box application’s client id and secret will allow access to Box APIs which require a current user.


  





--Andrea Cosentino ----------------------------------Apache Camel PMC ChairApache Karaf CommitterApache Servicemix PMC MemberEmail: [hidden email]: @oscerd2Github: oscerdOn Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote: I found the issue, and a solution.First there is a mistake in camel - box documentation.Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".If we use full endpoint name downloadPreviousFileVersion, the route will work.Also, there is a problem in camel - box endpoint mapping.I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.


Reply | Threaded
Open this post in threaded view
|

RE: Camel-box download file version

cherepnalkovski
I will test this, and reply.



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________
From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 28, 2018 11:44:00 AM
To: [hidden email]; Vladimir Cherepnalkovski
Subject: Re: Camel-box download file version

That class is generated. You just need to change the methodPattern here:

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/pom.xml#L278

If you are fancy opening a PR about that after testing the fix, you're welcome to do it

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:35:48 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote:







Done.



I hope that someone will change the mapping on backend, so the shorthand alias will be available for use.







From: Andrea Cosentino <[hidden email]>
Sent: Wednesday, November 28, 2018 11:22 AM
To: [hidden email]
Subject: Re: Camel-box download file version








You're welcome to work on a PR.The documentation for this component is herehttps://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc








camel/box-component.adoc at master · apache/camel · GitHub



github.com



Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com.The Box application’s client id and secret will allow access to Box APIs which require a current user.








--Andrea Cosentino ----------------------------------Apache Camel PMC ChairApache Karaf CommitterApache Servicemix PMC MemberEmail: [hidden email]: @oscerd2Github: oscerdOn Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <[hidden email]> wrote: I found the issue, and a solution.First there is a mistake in camel - box documentation.Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".If we use full endpoint name downloadPreviousFileVersion, the route will work.Also, there is a problem in camel - box endpoint mapping.I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.