Re: Bindy CSV not Marshaling

2010-06-11 Thread cmoulliard

I have committed a fix on camel

You can test it using the camel-2.4-SNASPHOT

and you will have now an error :

@Section and/or @KeyValuePairDataField have not been defined !

KR,

Charles


Nick Heudecker wrote:
 
 Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
 First, BindyAbstractFactory#generateKey() creates an invalid number if you
 don't define a @Section annotation.  You'll get a key like 'null000',
 resulting in a NumberFormatException.
 
 Next, Bindy doesn't support Booleans or booleans.
 
 
 
 On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen claus.ib...@gmail.com
 wrote:
 
 On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker nheudec...@gmail.com
 wrote:
  Are there known issues with Bindy and marshaling POJOs to CSV?  I
 followed
  the example and my objects aren't getting past the marshal(...) step
 with
  data.  I'm getting a zero-length byte[] in the exchange after the
  marshal(...) step.  What am I missing?
 

 Hi

 You may have to add more details. What Camel version. What does your
 POJO looks like with the annotations.
 Can you see an exception in the logs etc.

 At first I suggest to take a look at the unit tests of camel-bindy or
 chapter 3 in the Camel in Action book which contains a Bindy example.
 The source code for the book is free so you can actually find the
 source code for the example there.


 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus

 
 


-
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: 
http://old.nabble.com/Bindy-CSV-not-Marshaling-tp28719942p28856371.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Bindy CSV not Marshaling

2010-06-01 Thread Nick Heudecker
 How do you want to map booleans? I have never seen any CSV file with
 true or false as values.
 You most likely need to define a custom mapping scheme. Such as Y =
 true, N = false etc.
 And so you can use String type and add a isXXX boolean method yourself
 in the bean.

 Having a mapping for boolean in Bindy is of course nice but I think it
 requires additional mapping definition to set the rules.


Does this mapping capability exist and I missed it?



 
  Can you create tickets in JIRA about the bugs and if possible a little
  piece of sample to go along?
  http://issues.apache.org/activemq/browse/CAMEL
 

 I created the ticket
 https://issues.apache.org/activemq/browse/CAMEL-2773


Thanks.


Re: Bindy CSV not Marshaling

2010-06-01 Thread Claus Ibsen
On Tue, Jun 1, 2010 at 8:42 AM, Nick Heudecker nheudec...@gmail.com wrote:
 How do you want to map booleans? I have never seen any CSV file with
 true or false as values.
 You most likely need to define a custom mapping scheme. Such as Y =
 true, N = false etc.
 And so you can use String type and add a isXXX boolean method yourself
 in the bean.

 Having a mapping for boolean in Bindy is of course nice but I think it
 requires additional mapping definition to set the rules.


 Does this mapping capability exist and I missed it?


No I dont think so.



 
  Can you create tickets in JIRA about the bugs and if possible a little
  piece of sample to go along?
  http://issues.apache.org/activemq/browse/CAMEL
 

 I created the ticket
 https://issues.apache.org/activemq/browse/CAMEL-2773


 Thanks.




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Bindy CSV not Marshaling

2010-06-01 Thread Charles Moulliard
As mentioned by claus, this mapping does not exist.

This could be an excellent idea to add enumeration in the model and
use it to validate the content parsed. Enumeration could be used not
only for this simple case where we would like to check if we get Y, N
or true, false but also to check list value and transform it.

ex : C = cancel for order process,  A = accept, ...

I have assigned the ticket to me and will work on that when I will add
fixed length format to Bindy and solve some bugs discovered.

Kind regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel/ServiceMix Committer

***
- Blog : http://cmoulliard.blogspot.com
- Twitter : http://twitter.com/cmoulliard
- Linkedlin : http://www.linkedin.com/in/charlesmoulliard



On Tue, Jun 1, 2010 at 9:00 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 On Tue, Jun 1, 2010 at 8:42 AM, Nick Heudecker nheudec...@gmail.com wrote:
 How do you want to map booleans? I have never seen any CSV file with
 true or false as values.
 You most likely need to define a custom mapping scheme. Such as Y =
 true, N = false etc.
 And so you can use String type and add a isXXX boolean method yourself
 in the bean.

 Having a mapping for boolean in Bindy is of course nice but I think it
 requires additional mapping definition to set the rules.


 Does this mapping capability exist and I missed it?


 No I dont think so.



 
  Can you create tickets in JIRA about the bugs and if possible a little
  piece of sample to go along?
  http://issues.apache.org/activemq/browse/CAMEL
 

 I created the ticket
 https://issues.apache.org/activemq/browse/CAMEL-2773


 Thanks.




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Re: Bindy CSV not Marshaling

2010-05-30 Thread Nick Heudecker
Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
First, BindyAbstractFactory#generateKey() creates an invalid number if you
don't define a @Section annotation.  You'll get a key like 'null000',
resulting in a NumberFormatException.

Next, Bindy doesn't support Booleans or booleans.



On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker nheudec...@gmail.com
 wrote:
  Are there known issues with Bindy and marshaling POJOs to CSV?  I
 followed
  the example and my objects aren't getting past the marshal(...) step with
  data.  I'm getting a zero-length byte[] in the exchange after the
  marshal(...) step.  What am I missing?
 

 Hi

 You may have to add more details. What Camel version. What does your
 POJO looks like with the annotations.
 Can you see an exception in the logs etc.

 At first I suggest to take a look at the unit tests of camel-bindy or
 chapter 3 in the Camel in Action book which contains a Bindy example.
 The source code for the book is free so you can actually find the
 source code for the example there.


 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus