You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2006/11/05 22:11:16 UTC
svn commit: r471531 - in /incubator/servicemix/site/main: email.html
file.html
Author: chirino
Date: Sun Nov 5 13:11:15 2006
New Revision: 471531
URL: http://svn.apache.org/viewvc?view=rev&rev=471531
Log:
Latest export from confluence
Modified:
incubator/servicemix/site/main/email.html
incubator/servicemix/site/main/file.html
Modified: incubator/servicemix/site/main/email.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/email.html?view=diff&rev=471531&r1=471530&r2=471531
==============================================================================
--- incubator/servicemix/site/main/email.html (original)
+++ incubator/servicemix/site/main/email.html Sun Nov 5 13:11:15 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="Email">Email</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="Email">Email</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -113,23 +113,100 @@
<!--
<div class="pagetitle">Email</div>
-->
- <DIV class="wiki-content">
-<P>We currently support MIME email sending via <SPAN class="nobr"><A href="http://java.sun.com/products/javamail/" title="Visit page outside Confluence" rel="nofollow">JavaMail<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>. The following example shows the configuration of the JavaMail email sender component.</P>
+ <DIV class="wiki-content"><P>We currently support MIME email sending via <SPAN class="nobr"><A href="http://java.sun.com/products/javamail/" title="Visit page outside Confluence" rel="nofollow">JavaMail<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>. The following example shows the configuration of the JavaMail email sender component.</P>
<P>We also support the simpler <SPAN class="nobr"><A href="http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/mail/MailSender.html" title="Visit page outside Confluence" rel="nofollow">MailSender<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> from Spring, such as to work with <SPAN class="nobr"><A href="http://servlets.com/cos" title="Visit page outside Confluence" rel="nofollow">COS<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>.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"emailSender"</SPAN> service=<SPAN class="code-quote">"foo:emailSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.email.SimpleMailSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"sender"</SPAN> ref=<SPAN class="code-quote">"cosMailSender"</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>
<H3><A name="Email-Usingmessageproperties"></A>Using message properties</H3>
<P>The default configuration of the email sender uses the supplied message properties to figure out how to send the email. The following code shows this in use</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.email.to"</SPAN>, <SPAN class="code-quote">"scm@servicemix.org"</SPAN>);
+message.setProperty(<SPAN class="code-quote">"org.apache.servicemix.email.from"</SPAN>, <SPAN class="code-quote">"junit@servicemix.org"</SPAN>);
+message.setProperty(<SPAN class="code-quote">"org.apache.servicemix.email.subject"</SPAN>, <SPAN class="code-quote">"Hello from JUnit!"</SPAN>);
+message.setProperty(<SPAN class="code-quote">"org.apache.servicemix.email.text"</SPAN>, <SPAN class="code-quote">"Hi from test <SPAN class="code-keyword">case</SPAN>: "</SPAN> + getName() + <SPAN class="code-quote">" running at: "</SPAN> + <SPAN class="code-keyword">new</SPAN> Date());
+client.sendSync(exchange);</PRE>
+</DIV></DIV>
<H3><A name="Email-Usingexpressions"></A>Using expressions</H3>
<P>You can also use <A href="expressions.html" title="Expressions">Expressions</A> to configure the various properties on the email. The following example uses a mixture of constant expression and XPath expressions. This means that the sender component will use XPath to extract information from the message content and use that to create the email.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"simpleMailSenderWithExpressions"</SPAN> service=<SPAN class="code-quote">"foo:simpleMailSenderWithExpressions"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.email.SimpleMailSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"sender"</SPAN> ref=<SPAN class="code-quote">"javaMailSender"</SPAN>/></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.email.SimpleMailMarshaler"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"from"</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">"/person/email"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"to"</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">"/person/accountant/email"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"subject"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.ConstantExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"Drink a beer"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"text"</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('Hello there ', /person/name, ' how are you today?')"</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>
<P>This example uses property expressions; that is extracting properties from the message.</P>
-</DIV>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"simpleMailSenderWithPropertyExpressions"</SPAN> service=<SPAN class="code-quote">"foo:simpleMailSenderWithPropertyExpressions"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.email.SimpleMailSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"sender"</SPAN> ref=<SPAN class="code-quote">"javaMailSender"</SPAN>/></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.email.SimpleMailMarshaler"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"from"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.PropertyExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"from"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"to"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.PropertyExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"to"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"subject"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.ConstantExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"Subject came from expression"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"text"</SPAN>></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.expression.PropertyExpression"</SPAN>></SPAN>
+ <SPAN class="code-tag"><constructor-arg value=<SPAN class="code-quote">"text"</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></DIV>
<!--
<div class="tabletitle">
@@ -153,8 +230,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=2036&originalId=5183">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=2036&originalId=14794">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=2036">edit page</A>)
</DIV>
Modified: incubator/servicemix/site/main/file.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/site/main/file.html?view=diff&rev=471531&r1=471530&r2=471531
==============================================================================
--- incubator/servicemix/site/main/file.html (original)
+++ incubator/servicemix/site/main/file.html Sun Nov 5 13:11:15 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="File">File</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="File">File</A>
</DIV>
</TD>
<TD align="right" valign="middle" nowrap="">
@@ -116,11 +116,38 @@
<DIV class="wiki-content"><P>These components write messages to files in a directory or poll files or directories (possibly recursively) to send files into the JBI.</P>
<P>Firstly here is the poller which will poll a file or directory (recursively by default) to find files, which are then sent into the JBI bus</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"filePoller"</SPAN> service=<SPAN class="code-quote">"foo:filePoller"</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.file.FilePoller"</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">"file"</SPAN> value=<SPAN class="code-quote">"target/test-data/file"</SPAN>/></SPAN>
+ <!--
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"delete"</SPAN> value=<SPAN class="code-quote">"false"</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>
<P> </P>
<P>Then here's the sender. We're using a FileMarshaler here to turn JBI messages into files with an expression using XPath from the message content to generate the file name in the directory.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec componentName=<SPAN class="code-quote">"fileSender"</SPAN> service=<SPAN class="code-quote">"foo:fileSender"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN class="code-tag"><bean class=<SPAN class="code-quote">"org.apache.servicemix.components.file.FileWriter"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"directory"</SPAN> value=<SPAN class="code-quote">"target/test-data/file"</SPAN>/></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('sample_', /sample/@id, '.xml')"</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>
<P> </P>
<P>You can if you prefer let the operating system generate temporary file names in the directory specifying an optional prefix and suffix.</P>
@@ -147,8 +174,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 Oct 21, 2006
- (<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=2098&originalId=14365">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=2098&originalId=14795">view change</A>)
(<A href="http://goopen.org/confluence/pages/editpage.action?pageId=2098">edit page</A>)
</DIV>