You should extend the default FileMarhaler and customize it.

Cheers,
Guillaume Nodet

On 5/10/06, gioppo <[EMAIL PROTECTED]> wrote:

Hi.
I'm new of servicemix.
I'm trying to read the content of a mailbox getting the messages with
attachments and saving them on file (for now) after I'll need to ransform
them, create a pdf and in the end print them.
Since I'm new Now I'd like just to start with something simple so get the
mail and create a file from it.
I managed to read the mail, but I have problem in creating the file.
I think that the filemarshaller just believe that he will find a file in the
message but there is a mail.
So there could be the need of a custom marshaller that does the  transfer
from mail to file.
Do I have to write the class on my own or there is something I'm missing,
can I chain marshallers?
Can I instruct the file marshaller to get stuff from the mailmarshaller?

I'll send you the servicemix.xml file
Thanks
Luca

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0";
        xmlns:spring="http://xbean.org/schemas/spring/1.0";
        xmlns:sm="http://servicemix.apache.org/config/1.0";
        xmlns:foo="http://servicemix.org/demo/";>

        <!-- the JBI container -->
        <sm:container id="jbi" useMBeanServer="true"
                createMBeanServer="true" dumpStats="true" statsInterval="10">

                <sm:activationSpecs>
                        <!-- Read from mailbox -->
                        <sm:activationSpec componentName="mimePoller" 
service="foo:mimePoller"
destinationService="foo:fileSender">
                          <sm:component><bean
class="org.apache.servicemix.components.email.MimeMailPoller">
                                <property name="hostName" value="10.102.64.94" 
/>
                                <property name="userName" value="gioppo" />
                                <property name="password" value="xxxxxx" />
                                <property name="maxFetchSize" value="1" />
                                <property name="mailBox" value="Inbox" />
                                <property name="workManager" ref="workManager" 
/>
                                <property name="period" value="1000" />
                          </bean></sm:component>
                        </sm:activationSpec>

                        <!-- Write files to the outbox directory -->
                        <sm:activationSpec componentName="fileSender"
                                service="foo:fileSender">
                                <sm:component>
                                        <bean 
xmlns="http://xbean.org/schemas/spring/1.0";
                                                
class="org.apache.servicemix.components.file.FileWriter">
                                                <property name="directory" 
value="outbox" />
                                                <property name="marshaler">
                                                        <bean
                                                                
class="org.apache.servicemix.components.util.DefaultFileMarshaler">
                                                                <property 
name="fileName">
                                                                        <bean 
class="org.apache.servicemix.expression.PropertyExpression">
                                                                                
<constructor-arg value="org.apache.servicemix.email.from"/>
                                                                        </bean>
                                                                </property>
                                                        </bean>
                                                </property>
                                        </bean>
                                </sm:component>
                        </sm:activationSpec>

                </sm:activationSpecs>
        </sm:container>

        <!-- the work manager (thread pool) for this container -->
        <bean id="workManager"
                class="org.jencks.factory.WorkManagerFactoryBean">
                <property name="threadPoolSize" value="30" />
        </bean>

</beans>



--
View this message in context: 
http://www.nabble.com/Mail-to-file-problem-t1590526.html#a4316340
Sent from the ServiceMix - User forum at Nabble.com.


Reply via email to