Hi

You can use a processor or bean to do the transformation in plain old good java 
;)

http://activemq.apache.org/camel/bean-integration.html

The bean can be configured in spring as:
<to uri="bean:mySpringBean"/>

And the processor as:
<process ref="mySpringBeanThatImplementsProcessor"/>

And then you need the regular spring beans configuration in spring as well to 
link to the actual class file
<bean id="mySpringBeanThatImplementsProcessor" class="xxx.yyy"/>
<bean id="mySpringBean" class="xxx.yyy.zzz"/>

mySpringBean is just a regular POJO that doesn't have to have import any camel 
classes.

mySpringBeanThatImplementsProcessor must implement the Processor interface.


You can also do xpath since your payload is XML. Then you will be able to match 
and grab the textpart quite simple

I am no xpath expert but it is something like this:
<xpath>//textbody</xpath>

http://activemq.apache.org/camel/xpath.html



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: MMA [mailto:[EMAIL PROTECTED] 
Sent: 25. juli 2008 10:09
To: [email protected]
Subject: Transformation task in Spring


Hi,

I am new to ActiveMQ / camel. Up to now I was not able to solve the
following problem:

I have this xml structure in a file:

sendby>eMail</sendby>
<language>EN</language>
<priority>low</priority>
<headline>Reminder</headline>
<from>[EMAIL PROTECTED]</from>
<to>[EMAIL PROTECTED]</to>
<cc></cc>
<bcc></bcc>
<textbody>Text TextTextTextTextText</textbody>
<createtime></createtime>
<createby></createby>
<validuntil></validuntil>

I configure a route in camel that reads the file from the file system (from
uri file...).
finally I want to send a eMail using the uri smtp (to uri smtp).

But before sending it to the smtp uri i have to do a transformation. That is
my problem.
How can I configure in xml-spring that the content of my source file in the
tag "textbody" is shifted to the mail text of the smtp uri.

Thank you for any hints.

Regards
Martin

-- 
View this message in context: 
http://www.nabble.com/Transformation-task-in-Spring-tp18647141s22882p18647141.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to