Author: chirino
Date: Sun Nov 5 13:20:56 2006
New Revision: 471533
URL: http://svn.apache.org/viewvc?view=rev&rev=471533
Log:
Latest export from confluence
Modified:
incubator/servicemix/site/main/ftp.html
Modified: incubator/servicemix/site/main/ftp.html
URL:
http://svn.apache.org/viewvc/incubator/servicemix/site/main/ftp.html?view=diff&rev=471533&r1=471532&r2=471533
==============================================================================
--- incubator/servicemix/site/main/ftp.html (original)
+++ incubator/servicemix/site/main/ftp.html Sun Nov 5 13:20:56 2006
@@ -36,7 +36,7 @@
<TR>
<TD align="left" valign="middle" nowrap="">
<DIV id="site-breadcrumbs">
-<A href="home.html" title="ServiceMix">ServiceMix</A> > <A
href="home.html" title="Home">Home</A> > <A
href="documentation.html"
title="Documentation">Documentation</A> > <A
href="components.html" title="Components">Components</A> > <A
href="lightweight-components.html" title="Lightweight components">Lightweight
components</A> > <A href="" title="FTP">FTP</A>
+<A href="home.html" title="ServiceMix">ServiceMix</A> > <A
href="home.html" title="Home">Home</A> > <A
href="documentation.html"
title="Documentation">Documentation</A> > <A
href="components-list.html" title="Components list">Components
list</A> > <A href="lightweight-components.html"
title="Lightweight components">Lightweight components</A> > <A
href="" title="FTP">FTP</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -113,30 +113,94 @@
<!--
<div class="pagetitle">FTP</div>
-->
- <DIV class="wiki-content">
-<P>This component supports FTP via the <SPAN class="nobr"><A
href="http://jakarta.apache.org/commons/net.html" title="Visit page outside
Confluence" rel="nofollow">Jakarta Commons Net<SUP><IMG class="rendericon"
src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0"
width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN> library.</P>
+ <DIV class="wiki-content"><P>This component supports FTP via the
<SPAN class="nobr"><A href="http://jakarta.apache.org/commons/net.html"
title="Visit page outside Confluence" rel="nofollow">Jakarta Commons
Net<SUP><IMG class="rendericon"
src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0"
width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN> library.</P>
<H2><A name="FTP-SendingfilesoverFTP"></A>Sending files over FTP</H2>
<P>The default behaviour of sending files over FTP is for the message content
to be the text which gets written into the file. For example this example..</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">InOnly exchange = client.createInOnlyExchange();
+NormalizedMessage message = exchange.getInMessage();
-<P>will generate an XML text file on the FTP server. Here is an example of the
FTP configuration on the server side.</P>
+message.setContent(<SPAN class="code-keyword">new</SPAN> StringSource(<SPAN
class="code-quote">"<hello>world!</hello>"</SPAN>));
+client.sendSync(exchange);</PRE>
+</DIV></DIV>
+<P>will generate an XML text file on the FTP server. Here is an example of the
FTP configuration on the server side.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec
componentName=<SPAN class="code-quote">"ftpSender"</SPAN>
service=<SPAN class="code-quote">"foo:ftpSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN
class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.components.net.FTPSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"clientPool"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean id=<SPAN
class="code-quote">"ftpClientPool"</SPAN> class=<SPAN
class="code-quote">"org.apache.servicemix.components.net.FTPClientPool"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"host"</SPAN> value=<SPAN
class="code-quote">"localhost"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"username"</SPAN> value=<SPAN
class="code-quote">"servicemix"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"password"</SPAN> value=<SPAN
class="code-quote">"rocks"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN
class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<H3><A name="FTP-Usingpropertiestospecifythefilenameorcontent"></A>Using
properties to specify the file name or content</H3>
<P>You can use properties on the message to override the destination file name
and content. e.g.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">InOnly exchange = client.createInOnlyExchange();
+NormalizedMessage message = exchange.getInMessage();
+message.setProperty(<SPAN
class="code-quote">"org.apache.servicemix.file.name"</SPAN>, <SPAN
class="code-quote">"cheese.txt"</SPAN>);
+message.setProperty(<SPAN
class="code-quote">"org.apache.servicemix.file.content"</SPAN>, <SPAN
class="code-quote">"Hello World!"</SPAN>);
+
+client.sendSync(exchange);</PRE>
+</DIV></DIV>
<H3><A
name="FTP-YoucanalsousepluggableExpressionstoconfigurethefilenameand%2Forfilecontent."></A>You
can also use pluggable <A href="expressions.html"
title="Expressions">Expressions</A> to configure the file name and/or file
content.</H3>
<P>If you do not specify a file name then a unique file name is created using
a prefix you can specify (the <EM>uniqueFileName</EM> property).</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec
componentName=<SPAN
class="code-quote">"ftpSenderWithExpression"</SPAN> service=<SPAN
class="code-quote">"foo:ftpSenderWithExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN
class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.components.net.FTPSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"clientPool"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean id=<SPAN
class="code-quote">"ftpClientPool"</SPAN> class=<SPAN
class="code-quote">"org.apache.servicemix.components.net.FTPClientPool"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"host"</SPAN> value=<SPAN
class="code-quote">"localhost"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"username"</SPAN> value=<SPAN
class="code-quote">"servicemix"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"password"</SPAN> value=<SPAN
class="code-quote">"rocks"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"marshaler"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.components.util.DefaultFileMarshaler"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"fileName"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.expression.JaxenStringXPathExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN
class="code-quote">"concat('order_', order/@id,
'.csv')"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"content"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.expression.JaxenStringXPathExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN
class="code-quote">"concat(/order/customer, ',', /order/value,
',', /order/@id)"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN
class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<H3><A name="FTP-Pollingforfiles"></A>Polling for files</H3>
<P>The FTPPoller will poll the server (with an optional path) for files on the
FTP server then download them, fire them into the normalised message router and
then delete them from the FTP server. Here's an example of this in
action.</P>
-</DIV>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec
componentName=<SPAN class="code-quote">"ftpPoller"</SPAN>
service=<SPAN class="code-quote">"foo:ftpPoller"</SPAN>
destinationService=<SPAN
class="code-quote">"foo:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN
class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.components.net.FTPPoller"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"clientPool"</SPAN> ref=<SPAN
class="code-quote">"ftpClientPool"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"workManager"</SPAN> ref=<SPAN
class="code-quote">"workManager"</SPAN>/></SPAN>
+ <!--
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"path"</SPAN> value=<SPAN
class="code-quote">"foo"</SPAN>/></SPAN>
+ -->
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"period"</SPAN> value=<SPAN
class="code-quote">"1000"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN
class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV></DIV>
</DIV>
</TD>
@@ -146,8 +210,8 @@
</DIV>
<DIV id="site-footer">
Added by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James
Strachan</A>,
- last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on May 11, 2006
- (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=1999&originalId=5185">view
change</A>)
+ last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Nov 08, 2006
+ (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=1999&originalId=14796">view
change</A>)
(<A
href="http://goopen.org/confluence/pages/editpage.action?pageId=1999">edit
page</A>)
</DIV>