[jboss-cvs] jboss-seam/examples/mail/view ...

Peter Muir peter at bleepbleep.org.uk
Sun Jan 21 11:13:04 EST 2007


  User: pmuir   
  Date: 07/01/21 11:13:04

  Modified:    examples/mail/view      html.xhtml index.xhtml
  Added:       examples/mail/view      template.xhtml templating.xhtml
                        jboss.jpg
  Log:
  tidy up mail example
  
  Revision  Changes    Path
  1.2       +3 -3      jboss-seam/examples/mail/view/html.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: html.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/mail/view/html.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- html.xhtml	21 Jan 2007 14:41:54 -0000	1.1
  +++ html.xhtml	21 Jan 2007 16:13:04 -0000	1.2
  @@ -5,13 +5,13 @@
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core">
         <m:message>
  -	      <m:from name="Peter Muir" address="pmuir at bleepbleep.org.uk" />
  -	      <m:to name="Peter Muir" address="pmuir at tardis.ed.ac.uk" />
  +       <m:from name="Seam" address="do-not-reply at jboss.com" />
  +	      <m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
   	      <m:subject>Seam Mail</m:subject>
   	      <m:body>
   	      	<html>
   	      		<body>
  -	      			<p><b>Peter,</b></p>
  +	      			<p><b>#{person.firstname},</b></p>
   	      			<p>This is an example <i>HTML</i> email sent by Seam.</p>
   	      			<p>It has an alternative text body for mail readers that don't support html.</p>
   	      		</body>
  
  
  
  1.2       +6 -3      jboss-seam/examples/mail/view/index.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: index.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/mail/view/index.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- index.xhtml	21 Jan 2007 14:41:54 -0000	1.1
  +++ index.xhtml	21 Jan 2007 16:13:04 -0000	1.2
  @@ -14,7 +14,7 @@
      
       <h1>Sample Emails</h1>
       
  -    <p>If you aren't running a smtp server on localhost:25 you set one in components.xml</p>
  +    <p>If you aren't running a smtp server on localhost:25 you need to setup mailSession in components.xml</p>
       
       <h:form>
       	<h:panelGrid columns="2">
  @@ -25,8 +25,11 @@
   		    </h:panelGroup>
   		    <h:outputText value="Email Address" />
   		    <h:inputText value="#{person.address}" rerquired="true"/>
  +		</h:panelGrid>
  +		<h:panelGrid>
   		    <h:commandButton action="plainText" value="Send Plain Text Email" />
   	        <h:commandButton action="html" value="Send HTML Email" />
  +	        <h:commandButton action="templating" value="Send Templated Email" />
   		</h:panelGrid>
       </h:form>
   </body>
  
  
  
  1.1      date: 2007/01/21 16:13:04;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/template.xhtml
  
  Index: template.xhtml
  ===================================================================
  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:m="http://jboss.com/products/seam/mail"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">
        <m:message>
         <m:from name="Seam" address="do-not-reply at jboss.com" />
  	      <m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
  	      <m:subject>#{subject}</m:subject>
  	      <m:body>
  	      	<html>
  	      		<body>
  			      	<ui:insert name="body">
  			      		This is the default body, specified by the template.
  			      	</ui:insert>
  			      </body>
  			   	</html>
  		      	<f:facet name="alternative">
  		      		<ui:insert name="alternative">
  			      		<h:outputText>Sorry, your mail reader doesn't support html.</h:outputText>
  			      	</ui:insert>
  		      	</f:facet>
  	      </m:body>
       </m:message>
       <ui:insert name="successMessage">
  	     <html>
  		     <body>
  		     	<p>The email has been successfully sent. <s:link view="/index.xhtml">Click here</s:link> to return to the index.</p>
  		     </body>
  	     </html>
  	</ui:insert>
  </ui:composition>
  
  
  1.1      date: 2007/01/21 16:13:04;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/templating.xhtml
  
  Index: templating.xhtml
  ===================================================================
  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:m="http://jboss.com/products/seam/mail"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        template="template.xhtml">
        <ui:param name="subject" value="Templating with Seam Mail" />
        <ui:define name="body">
        	<p>This email demonstrates that you can easily use <i>facelets templating features</i> in your code!</p>
        	
        	<p>In fact you can use <b>any</b> JSF tags that you like!</p>
        	
        	<p>Here's a dataTable</p>
        	
        	<h:dataTable value="#{lists.daysOfWeek}" var="day">
        		<h:column>
  	      		<f:facet name="header">
  	      			Day
  	      		</f:facet>
  	      		<h:outputText value="#{day}" />
  	      	</h:column>
        	</h:dataTable>
        </ui:define>
  </ui:composition>
  
  
  1.1      date: 2007/01/21 16:13:04;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/jboss.jpg
  
  	<<Binary file>>
  
  



More information about the jboss-cvs-commits mailing list