You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Joe San <co...@gmail.com> on 2012/08/23 16:37:42 UTC

Camel JMS to CSV (with Excel Strategy)

I would have to route a JMS message which I guess would be from Tibco to a
CSV file to be saved as .xls in a file system.

I guess I have to use both the JAXB and Bindy dataformats. JAXB to
unmarshall from xml to Java and marshall from java to csv using Bindy. But
can I annotate the same domain object which I get from the generated JAXB
with annotations from the Bindy?

Regards,
Jothi

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
Here is more specific of what I'm trying to do:

I have a route that listens for JMS messages in a Queue and these JMS
messages are SOAP xml messages. In this message, I have to filter out
certain piece of the xml and convert that to a CSV format which will
finally be stored as an excel file:

          ....
          ....
          <pss:persons xmlns:pss="persons:datatype">
            <rss:person xmlns:rss="person:datatype">
                <name>jothi</name>
                <age>32</age>
                <gender>M</gender>
            </rss:person>
          </ns:persons>
          ....
          ....

My idea is to create a java representation of the above piece of xml and
use the JAXB transformation to get the values from the xml to my Java
object. Later use Bindy to write to the CSV.

Is my approach correct? How could I extract the xml that I"m interested in?

Regards,
Jothi

On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com> wrote:

> I would have to route a JMS message which I guess would be from Tibco to a
> CSV file to be saved as .xls in a file system.
>
> I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> unmarshall from xml to Java and marshall from java to csv using Bindy. But
> can I annotate the same domain object which I get from the generated JAXB
> with annotations from the Bindy?
>
> Regards,
> Jothi
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
Thanks for the suggestion. I was just messing around with the routes and
transformations.

I will have a look at the EIP's.

Regards,
Jothi

On Fri, Aug 24, 2012 at 2:04 PM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> I suggest to read background information about the EIPs you are using,
> eg in this case the filter EIP.
>
> The filter is only for routing, its like an if structure:
>
> if X {
>    ....
> }
>
> The filter does not alter, transform, or anyhow change the message.
>
> If you want to change the message, then look for some of the EIPs for
> the such as message translator, content enricher, etc.
> And in your case there is also the splitter EIP if you want to split
> up a messages into multiple messages.
>
> The eips is all documented here
> http://camel.apache.org/eip
>
> And for comprehensive background materiel, then there is the EIP
> bible, the EIP book by Gregor and Bobby. A link to the book from here
> http://camel.apache.org/books
>
>
> On Fri, Aug 24, 2012 at 11:43 AM, Joe San <co...@gmail.com> wrote:
> > May be I started with a complex example. So I decided to start with a
> > simple xml without namespace definitions:
> >
> > <info>
> >     <address>
> >         <street>xyz</street>
> >         <city>Frankfurt</city>
> >     </address>
> >     <person>
> >         <name>jothi</name>
> >         <age>32</age>
> >         <country>Germany</country>
> >     </person>
> > </info>
> >
> > Goal is to read the above xml from inbox, split and extract the person
> and
> > write that as an xml to outbox.
> >
> > I have the route definition as below:
> >
> >
> from("file://C:/folders/inbox?noop=true").filter().xpath("//info/person/name").to("file://C:/folders/outbox");
> >
> > The route runs without and problems, but the outbox contains the same xml
> > as inbox. I would expect the outbox to have just the following:
> >
> >     <person>
> >         <name>jothi</name>
> >         <age>32</age>
> >         <country>Germany</country>
> >     </person>
> >
> > Why does it not filter? I'm sure that I'm doing something wrong here. Can
> > anyone please point out the mistake?
> >
> > Regards,
> > Jothi
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I suggest to read background information about the EIPs you are using,
eg in this case the filter EIP.

The filter is only for routing, its like an if structure:

if X {
   ....
}

The filter does not alter, transform, or anyhow change the message.

If you want to change the message, then look for some of the EIPs for
the such as message translator, content enricher, etc.
And in your case there is also the splitter EIP if you want to split
up a messages into multiple messages.

The eips is all documented here
http://camel.apache.org/eip

And for comprehensive background materiel, then there is the EIP
bible, the EIP book by Gregor and Bobby. A link to the book from here
http://camel.apache.org/books


On Fri, Aug 24, 2012 at 11:43 AM, Joe San <co...@gmail.com> wrote:
> May be I started with a complex example. So I decided to start with a
> simple xml without namespace definitions:
>
> <info>
>     <address>
>         <street>xyz</street>
>         <city>Frankfurt</city>
>     </address>
>     <person>
>         <name>jothi</name>
>         <age>32</age>
>         <country>Germany</country>
>     </person>
> </info>
>
> Goal is to read the above xml from inbox, split and extract the person and
> write that as an xml to outbox.
>
> I have the route definition as below:
>
> from("file://C:/folders/inbox?noop=true").filter().xpath("//info/person/name").to("file://C:/folders/outbox");
>
> The route runs without and problems, but the outbox contains the same xml
> as inbox. I would expect the outbox to have just the following:
>
>     <person>
>         <name>jothi</name>
>         <age>32</age>
>         <country>Germany</country>
>     </person>
>
> Why does it not filter? I'm sure that I'm doing something wrong here. Can
> anyone please point out the mistake?
>
> Regards,
> Jothi



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
May be I started with a complex example. So I decided to start with a
simple xml without namespace definitions:

<info>
    <address>
        <street>xyz</street>
        <city>Frankfurt</city>
    </address>
    <person>
        <name>jothi</name>
        <age>32</age>
        <country>Germany</country>
    </person>
</info>

Goal is to read the above xml from inbox, split and extract the person and
write that as an xml to outbox.

I have the route definition as below:

from("file://C:/folders/inbox?noop=true").filter().xpath("//info/person/name").to("file://C:/folders/outbox");

The route runs without and problems, but the outbox contains the same xml
as inbox. I would expect the outbox to have just the following:

    <person>
        <name>jothi</name>
        <age>32</age>
        <country>Germany</country>
    </person>

Why does it not filter? I'm sure that I'm doing something wrong here. Can
anyone please point out the mistake?

Regards,
Jothi

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
I guess I got the wrong expression for xpath:

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:
/*/child::pss:person/text(). Reason:
javax.xml.xpath.XPathExpressionException
    at
org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:686)
    at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:667)
    at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:147)
    at
org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:101)
    at
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:209)
    at org.apache.camel.processor.Splitter.process(Splitter.java:96)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)
    at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
    at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
    at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)
    at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91)

On Fri, Aug 24, 2012 at 11:08 AM, Joe San <co...@gmail.com> wrote:

> I tried this xpath example in my route and got the below exception:
>
> My Route definition:
> from("file://C:/folders/inbox?noop=true").split(xpath("/*/child::pss:persons/text()")).to("file://C:/folders/outbox");
>
> Caused by:
> com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
> Prefix must resolve to a namespace: pss
>     at
> com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(Unknown
> Source)
>     at
> com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Unknown Source)
>     at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Unknown
> Source)
>     at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Unknown
> Source)
>     at
> com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(Unknown
> Source)
>     at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
>     at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
>     ... 46 more
>
> I can understand that I have to define the namespace but where do I do
> that?
>
> Regards,
> Jothi
>
>
> On Fri, Aug 24, 2012 at 9:22 AM, Joe San <co...@gmail.com> wrote:
>
>> Ok. After a bit of reading about xPath, I have the following. But not
>> sure if this would work as expected.
>>
>> The xml:
>>
>>           ....
>>           ....
>>           <pss:persons xmlns:pss="persons:datatype">
>>             <rss:person xmlns:rss="person:datatype">
>>                 <name>jothi</name>
>>                 <age>32</age>
>>                 <gender>M</gender>
>>             </rss:person>
>>           </ns:persons>
>>           ....
>>           ....
>>
>> The xPath:
>>
>> /*/child:psst:persons/text()
>>
>> Would fetch me all the tags under pss:persons. Did I get this right?
>>
>> Regards,
>> Jothi
>>
>
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
I tried this xpath example in my route and got the below exception:

My Route definition:
from("file://C:/folders/inbox?noop=true").split(xpath("/*/child::pss:persons/text()")).to("file://C:/folders/outbox");

Caused by:
com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
Prefix must resolve to a namespace: pss
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(Unknown
Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    ... 46 more

I can understand that I have to define the namespace but where do I do that?

Regards,
Jothi

On Fri, Aug 24, 2012 at 9:22 AM, Joe San <co...@gmail.com> wrote:

> Ok. After a bit of reading about xPath, I have the following. But not sure
> if this would work as expected.
>
> The xml:
>
>           ....
>           ....
>           <pss:persons xmlns:pss="persons:datatype">
>             <rss:person xmlns:rss="person:datatype">
>                 <name>jothi</name>
>                 <age>32</age>
>                 <gender>M</gender>
>             </rss:person>
>           </ns:persons>
>           ....
>           ....
>
> The xPath:
>
> /*/child:psst:persons/text()
>
> Would fetch me all the tags under pss:persons. Did I get this right?
>
> Regards,
> Jothi
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
Ok. After a bit of reading about xPath, I have the following. But not sure
if this would work as expected.

The xml:
          ....
          ....
          <pss:persons xmlns:pss="persons:datatype">
            <rss:person xmlns:rss="person:datatype">
                <name>jothi</name>
                <age>32</age>
                <gender>M</gender>
            </rss:person>
          </ns:persons>
          ....
          ....

The xPath:

/*/child:psst:persons/text()

Would fetch me all the tags under pss:persons. Did I get this right?

Regards,
Jothi

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
A small bug in that page:

Most of the links under Variables result in a 404.
http://camel.apache.org/xml/function/ gives a 404

I do not see anywhere in that page where there is some sample showing the
extraction of a set of xml tags using xpath

Regards,
Jothi

On Fri, Aug 24, 2012 at 8:51 AM, Charles Moulliard <ch...@gmail.com> wrote:

> Hi Jothi,
>
> You can have a look here http://camel.apache.org/xpath.html
>
> Regards,
>
>
>
> On Fri, Aug 24, 2012 at 8:20 AM, Joe San <co...@gmail.com> wrote:
>
> > When versioning with the package names, I would end up changing the
> imports
> > of these models in my classes that use these models. Yes it is just a
> > ctrl+o in eclipse, but still I would give it a thought.
> >
> > Now back to my original question, how can I filter the xml that I posted
> > above in the mail thread to extract a specific set of xml elements using
> > xpath. Can anyone point me to an example?
> >
> > Regards,
> > Jothi
> >
> > On Fri, Aug 24, 2012 at 8:13 AM, Charles Moulliard <ch...@gmail.com>
> > wrote:
> >
> > > Hi Jothi,
> > >
> > > Christian suggests to define package name with a version number like
> > this :
> > >
> > > com.mycompany.domain.v1_0.mymodel
> > > com.mycompany.domain.v1_1.mymodel
> > > com.mycompany.domain.v2_0.mymodel
> > >
> > > So, based on different xsd files, you will generate domain classes that
> > you
> > > can next enrich with Bindy annotations.
> > >
> > > Regards,
> > >
> > >
> > >
> > > On Fri, Aug 24, 2012 at 6:47 AM, Joe San <co...@gmail.com>
> > wrote:
> > >
> > > > Christian,
> > > >
> > > > I did not get your point. In one of my earlier projects, we used to
> > > version
> > > > the xsd file in SVN. But when you say version the generated objects,
> > do I
> > > > do it using an annotation? Can that also be generated as well?
> > > >
> > > > Regards,
> > > > Jothi
> > > >
> > > > On Thu, Aug 23, 2012 at 10:38 PM, Christian Müller <
> > > > christian.mueller@gmail.com> wrote:
> > > >
> > > > > But than you cannot re-generate your JAXB objects. You should
> > consider
> > > to
> > > > > version the generated and annotated domain objects instead to
> > generate
> > > it
> > > > > from your XSD file...
> > > > >
> > > > > Best,
> > > > > Christian
> > > > >
> > > > > On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <
> ch007m@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Yep. You can annotated your domain class with both JAXB and Bindy
> > > > > > annotations.
> > > > > >
> > > > > > On Thu, Aug 23, 2012 at 4:37 PM, Joe San <
> codeintheopen@gmail.com>
> > > > > wrote:
> > > > > >
> > > > > > > I would have to route a JMS message which I guess would be from
> > > Tibco
> > > > > to
> > > > > > a
> > > > > > > CSV file to be saved as .xls in a file system.
> > > > > > >
> > > > > > > I guess I have to use both the JAXB and Bindy dataformats. JAXB
> > to
> > > > > > > unmarshall from xml to Java and marshall from java to csv using
> > > > Bindy.
> > > > > > But
> > > > > > > can I annotate the same domain object which I get from the
> > > generated
> > > > > JAXB
> > > > > > > with annotations from the Bindy?
> > > > > > >
> > > > > > > Regards,
> > > > > > > Jothi
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Charles Moulliard
> > > > > > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > > > > > Twitter : @cmoulliard
> > > > > > Blog : http://cmoulliard.blogspot.com
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > > Twitter : @cmoulliard
> > > Blog : http://cmoulliard.blogspot.com
> > >
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Pr. Consultant at FuseSource.com
> Twitter : @cmoulliard
> Blog : http://cmoulliard.blogspot.com
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Charles Moulliard <ch...@gmail.com>.
Hi Jothi,

You can have a look here http://camel.apache.org/xpath.html

Regards,



On Fri, Aug 24, 2012 at 8:20 AM, Joe San <co...@gmail.com> wrote:

> When versioning with the package names, I would end up changing the imports
> of these models in my classes that use these models. Yes it is just a
> ctrl+o in eclipse, but still I would give it a thought.
>
> Now back to my original question, how can I filter the xml that I posted
> above in the mail thread to extract a specific set of xml elements using
> xpath. Can anyone point me to an example?
>
> Regards,
> Jothi
>
> On Fri, Aug 24, 2012 at 8:13 AM, Charles Moulliard <ch...@gmail.com>
> wrote:
>
> > Hi Jothi,
> >
> > Christian suggests to define package name with a version number like
> this :
> >
> > com.mycompany.domain.v1_0.mymodel
> > com.mycompany.domain.v1_1.mymodel
> > com.mycompany.domain.v2_0.mymodel
> >
> > So, based on different xsd files, you will generate domain classes that
> you
> > can next enrich with Bindy annotations.
> >
> > Regards,
> >
> >
> >
> > On Fri, Aug 24, 2012 at 6:47 AM, Joe San <co...@gmail.com>
> wrote:
> >
> > > Christian,
> > >
> > > I did not get your point. In one of my earlier projects, we used to
> > version
> > > the xsd file in SVN. But when you say version the generated objects,
> do I
> > > do it using an annotation? Can that also be generated as well?
> > >
> > > Regards,
> > > Jothi
> > >
> > > On Thu, Aug 23, 2012 at 10:38 PM, Christian Müller <
> > > christian.mueller@gmail.com> wrote:
> > >
> > > > But than you cannot re-generate your JAXB objects. You should
> consider
> > to
> > > > version the generated and annotated domain objects instead to
> generate
> > it
> > > > from your XSD file...
> > > >
> > > > Best,
> > > > Christian
> > > >
> > > > On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <ch007m@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Yep. You can annotated your domain class with both JAXB and Bindy
> > > > > annotations.
> > > > >
> > > > > On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com>
> > > > wrote:
> > > > >
> > > > > > I would have to route a JMS message which I guess would be from
> > Tibco
> > > > to
> > > > > a
> > > > > > CSV file to be saved as .xls in a file system.
> > > > > >
> > > > > > I guess I have to use both the JAXB and Bindy dataformats. JAXB
> to
> > > > > > unmarshall from xml to Java and marshall from java to csv using
> > > Bindy.
> > > > > But
> > > > > > can I annotate the same domain object which I get from the
> > generated
> > > > JAXB
> > > > > > with annotations from the Bindy?
> > > > > >
> > > > > > Regards,
> > > > > > Jothi
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Charles Moulliard
> > > > > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > > > > Twitter : @cmoulliard
> > > > > Blog : http://cmoulliard.blogspot.com
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > Twitter : @cmoulliard
> > Blog : http://cmoulliard.blogspot.com
> >
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
When versioning with the package names, I would end up changing the imports
of these models in my classes that use these models. Yes it is just a
ctrl+o in eclipse, but still I would give it a thought.

Now back to my original question, how can I filter the xml that I posted
above in the mail thread to extract a specific set of xml elements using
xpath. Can anyone point me to an example?

Regards,
Jothi

On Fri, Aug 24, 2012 at 8:13 AM, Charles Moulliard <ch...@gmail.com> wrote:

> Hi Jothi,
>
> Christian suggests to define package name with a version number like this :
>
> com.mycompany.domain.v1_0.mymodel
> com.mycompany.domain.v1_1.mymodel
> com.mycompany.domain.v2_0.mymodel
>
> So, based on different xsd files, you will generate domain classes that you
> can next enrich with Bindy annotations.
>
> Regards,
>
>
>
> On Fri, Aug 24, 2012 at 6:47 AM, Joe San <co...@gmail.com> wrote:
>
> > Christian,
> >
> > I did not get your point. In one of my earlier projects, we used to
> version
> > the xsd file in SVN. But when you say version the generated objects, do I
> > do it using an annotation? Can that also be generated as well?
> >
> > Regards,
> > Jothi
> >
> > On Thu, Aug 23, 2012 at 10:38 PM, Christian Müller <
> > christian.mueller@gmail.com> wrote:
> >
> > > But than you cannot re-generate your JAXB objects. You should consider
> to
> > > version the generated and annotated domain objects instead to generate
> it
> > > from your XSD file...
> > >
> > > Best,
> > > Christian
> > >
> > > On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <ch...@gmail.com>
> > > wrote:
> > >
> > > > Yep. You can annotated your domain class with both JAXB and Bindy
> > > > annotations.
> > > >
> > > > On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com>
> > > wrote:
> > > >
> > > > > I would have to route a JMS message which I guess would be from
> Tibco
> > > to
> > > > a
> > > > > CSV file to be saved as .xls in a file system.
> > > > >
> > > > > I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> > > > > unmarshall from xml to Java and marshall from java to csv using
> > Bindy.
> > > > But
> > > > > can I annotate the same domain object which I get from the
> generated
> > > JAXB
> > > > > with annotations from the Bindy?
> > > > >
> > > > > Regards,
> > > > > Jothi
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Charles Moulliard
> > > > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > > > Twitter : @cmoulliard
> > > > Blog : http://cmoulliard.blogspot.com
> > > >
> > >
> > >
> > >
> > > --
> > >
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Pr. Consultant at FuseSource.com
> Twitter : @cmoulliard
> Blog : http://cmoulliard.blogspot.com
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Charles Moulliard <ch...@gmail.com>.
Hi Jothi,

Christian suggests to define package name with a version number like this :

com.mycompany.domain.v1_0.mymodel
com.mycompany.domain.v1_1.mymodel
com.mycompany.domain.v2_0.mymodel

So, based on different xsd files, you will generate domain classes that you
can next enrich with Bindy annotations.

Regards,



On Fri, Aug 24, 2012 at 6:47 AM, Joe San <co...@gmail.com> wrote:

> Christian,
>
> I did not get your point. In one of my earlier projects, we used to version
> the xsd file in SVN. But when you say version the generated objects, do I
> do it using an annotation? Can that also be generated as well?
>
> Regards,
> Jothi
>
> On Thu, Aug 23, 2012 at 10:38 PM, Christian Müller <
> christian.mueller@gmail.com> wrote:
>
> > But than you cannot re-generate your JAXB objects. You should consider to
> > version the generated and annotated domain objects instead to generate it
> > from your XSD file...
> >
> > Best,
> > Christian
> >
> > On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <ch...@gmail.com>
> > wrote:
> >
> > > Yep. You can annotated your domain class with both JAXB and Bindy
> > > annotations.
> > >
> > > On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com>
> > wrote:
> > >
> > > > I would have to route a JMS message which I guess would be from Tibco
> > to
> > > a
> > > > CSV file to be saved as .xls in a file system.
> > > >
> > > > I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> > > > unmarshall from xml to Java and marshall from java to csv using
> Bindy.
> > > But
> > > > can I annotate the same domain object which I get from the generated
> > JAXB
> > > > with annotations from the Bindy?
> > > >
> > > > Regards,
> > > > Jothi
> > > >
> > >
> > >
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > > Twitter : @cmoulliard
> > > Blog : http://cmoulliard.blogspot.com
> > >
> >
> >
> >
> > --
> >
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Joe San <co...@gmail.com>.
Christian,

I did not get your point. In one of my earlier projects, we used to version
the xsd file in SVN. But when you say version the generated objects, do I
do it using an annotation? Can that also be generated as well?

Regards,
Jothi

On Thu, Aug 23, 2012 at 10:38 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> But than you cannot re-generate your JAXB objects. You should consider to
> version the generated and annotated domain objects instead to generate it
> from your XSD file...
>
> Best,
> Christian
>
> On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <ch...@gmail.com>
> wrote:
>
> > Yep. You can annotated your domain class with both JAXB and Bindy
> > annotations.
> >
> > On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com>
> wrote:
> >
> > > I would have to route a JMS message which I guess would be from Tibco
> to
> > a
> > > CSV file to be saved as .xls in a file system.
> > >
> > > I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> > > unmarshall from xml to Java and marshall from java to csv using Bindy.
> > But
> > > can I annotate the same domain object which I get from the generated
> JAXB
> > > with annotations from the Bindy?
> > >
> > > Regards,
> > > Jothi
> > >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Pr. Consultant at FuseSource.com
> > Twitter : @cmoulliard
> > Blog : http://cmoulliard.blogspot.com
> >
>
>
>
> --
>

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Christian Müller <ch...@gmail.com>.
But than you cannot re-generate your JAXB objects. You should consider to
version the generated and annotated domain objects instead to generate it
from your XSD file...

Best,
Christian

On Thu, Aug 23, 2012 at 5:29 PM, Charles Moulliard <ch...@gmail.com> wrote:

> Yep. You can annotated your domain class with both JAXB and Bindy
> annotations.
>
> On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com> wrote:
>
> > I would have to route a JMS message which I guess would be from Tibco to
> a
> > CSV file to be saved as .xls in a file system.
> >
> > I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> > unmarshall from xml to Java and marshall from java to csv using Bindy.
> But
> > can I annotate the same domain object which I get from the generated JAXB
> > with annotations from the Bindy?
> >
> > Regards,
> > Jothi
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Pr. Consultant at FuseSource.com
> Twitter : @cmoulliard
> Blog : http://cmoulliard.blogspot.com
>



--

Re: Camel JMS to CSV (with Excel Strategy)

Posted by Charles Moulliard <ch...@gmail.com>.
Yep. You can annotated your domain class with both JAXB and Bindy
annotations.

On Thu, Aug 23, 2012 at 4:37 PM, Joe San <co...@gmail.com> wrote:

> I would have to route a JMS message which I guess would be from Tibco to a
> CSV file to be saved as .xls in a file system.
>
> I guess I have to use both the JAXB and Bindy dataformats. JAXB to
> unmarshall from xml to Java and marshall from java to csv using Bindy. But
> can I annotate the same domain object which I get from the generated JAXB
> with annotations from the Bindy?
>
> Regards,
> Jothi
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com