cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gree...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail mail.xsl
Date Mon, 04 Dec 2000 02:05:52 GMT
greenrd     00/12/03 18:05:52

  Modified:    src/org/apache/cocoon/processor/xsp/library/mail mail.xsl
  Log:
  just in case anyone does not know the port number for pop3
  
  Revision  Changes    Path
  1.5       +13 -47    xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/mail.xsl
  
  Index: mail.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/mail.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mail.xsl	2000/10/16 04:00:55	1.4
  +++ mail.xsl	2000/12/04 02:05:52	1.5
  @@ -55,7 +55,7 @@
   
    <author>Donald A. Ball Jr.</author>
    <author>Ugo Cei</author>
  - <version>1.2</version>
  + <version>1.1</version>
   -->
   <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  @@ -75,11 +75,9 @@
      <xsp:include>javax.mail.Address</xsp:include>
      <xsp:include>javax.mail.Part</xsp:include>
      <xsp:include>javax.mail.Multipart</xsp:include>
  -   <xsp:include>javax.mail.Flags</xsp:include>
      <xsp:include>javax.mail.internet.MimeMessage</xsp:include>
      <xsp:include>javax.mail.internet.MimePart</xsp:include>
  -   <xsp:include>javax.mail.internet.InternetAddress</xsp:include>
  -   <xsp:include>java.text.DateFormat</xsp:include>
  +   <xsp:include>javax.text.DateFormat</xsp:include>
     </xsp:structure>
     <xsl:apply-templates/>
     <xsp:logic>
  @@ -123,7 +121,7 @@
      <xsl:with-param name="content" select="mail:host"/>
     </xsl:call-template>
    </xsl:variable>
  - <xsl:variable name="port">
  + <xsl:variable name="port">  <!-- POP3 is conventionally on port 110 -->
     <xsl:call-template name="get-nested-string">
      <xsl:with-param name="content" select="mail:port"/>
     </xsl:call-template>
  @@ -166,7 +164,7 @@
       String.valueOf(<xsl:copy-of select="$password"/>));
      Folder _mail_folder = _mail_store.getDefaultFolder();
      _mail_folder = _mail_folder.getFolder(String.valueOf(<xsl:copy-of select="$mbox"/>));
  -   _mail_folder.open(Folder.READ_WRITE);
  +   _mail_folder.open(Folder.READ_ONLY);
      <xsl:apply-templates select="mail:results/*"/>
      _mail_folder.close(false);
      _mail_store.close();
  @@ -220,7 +218,7 @@
     </xsp:logic>
   </xsl:template>
   
  -<xsl:template match="mail:results//mail:get-messages//mail:get-subject">
  +<xsl:template match="mail:results//mail:get-message//mail:get-subject">
    <xsp:expr>_mail_message.getSubject()</xsp:expr>
   </xsl:template>
   
  @@ -228,25 +226,18 @@
    <xsp:expr>DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.SHORT).format(_mail_message.getSentDate())</xsp:expr>
   </xsl:template>
   
  -<xsl:template match="mail:results//mail:get-messages//mail:get-from">
  +<xsl:template match="mail:results//mail:get-message//mail:get-from">
    <xsp:logic>
     {
      Address _mail_from[] = _mail_message.getFrom();
  -   for (int _mail_j=0; _mail_j &lt; _mail_from.length; _mail_j++) {
  -     if (_mail_from[_mail_j] instanceof InternetAddress) {
  -       InternetAddress _mail_ia = (InternetAddress) _mail_from[_mail_j];
  -       <internet-address>
  -         <address><xsp:expr>_mail_ia.getAddress()</xsp:expr></address>
  -         <personal><xsp:expr>_mail_ia.getPersonal()</xsp:expr></personal>
  -       </internet-address>
  -     }
  -     <address><xsp:expr>_mail_from[_mail_j].toString()</xsp:expr></address>
  +   for (int _mail_i=0; _mail_i &lt; _mail_from.length; _mail_i++) {
  +    <address><xsp:expr>_mail_from[_mail_i].toString()</xsp:expr></address>
      }
     }
    </xsp:logic>
   </xsl:template>
   
  -<xsl:template match="mail:results//mail:get-messages//mail:get-recipients">
  +<xsl:template match="mail:results//mail:get-message//mail:get-recipients">
    <xsp:logic>
     {
      String _mail_type = "<xsl:value-of select="@type"/>";
  @@ -264,40 +255,15 @@
      } else {
       _mail_to = _mail_message.getRecipients(_mail_recipient_type);
      }
  -   for (int _mail_j=0; _mail_j &lt; _mail_to.length; _mail_j++) {
  -    <address><xsp:expr>_mail_to[_mail_j].toString()</xsp:expr></address>
  +   for (int _mail_i=0; _mail_i &lt; _mail_to.length; _mail_i++) {
  +    <address><xsp:expr>_mail_to[_mail_i].toString()</xsp:expr></address>
      }
     }
    </xsp:logic>
   </xsl:template>
   
  -<xsl:template match="mail:results//mail:get-messages//mail:get-flags">
  +<xsl:template match="mail:results//mail:get-message//get-all-headers">
    <xsp:logic>
  -  {
  -    if (_mail_message.isSet(Flags.Flag.ANSWERED)) {
  -      <flag>answered</flag>
  -    }
  -    if (_mail_message.isSet(Flags.Flag.DELETED)) {
  -      <flag>deleted</flag>
  -    }
  -    if (_mail_message.isSet(Flags.Flag.DRAFT)) {
  -      <flag>draft</flag>
  -    }
  -    if (_mail_message.isSet(Flags.Flag.FLAGGED)) {
  -      <flag>flagged</flag>
  -    }
  -    if (_mail_message.isSet(Flags.Flag.RECENT)) {
  -      <flag>recent</flag>
  -    }
  -    if (_mail_message.isSet(Flags.Flag.SEEN)) {
  -      <flag>seen</flag>
  -    }
  -  }
  - </xsp:logic>
  -</xsl:template>
  -
  -<xsl:template match="mail:results//mail:get-messages//mail:get-all-headers">
  - <xsp:logic>
    {
     Enumeration _mail_enum = _mail_message.getAllHeaderLines();
     while (_mail_enum.hasMoreElements()) {
  @@ -307,7 +273,7 @@
    </xsp:logic>
   </xsl:template>
   
  -<xsl:template match="mail:results//mail:get-messages//mail:get-content">
  +<xsl:template match="mail:results//mail:get-message//get-content">
    <xsp:logic>
     _mail_process_content(request,response,document,xspParentNode,xspCurrentNode,xspNodeStack,session,_mail_message);
    </xsp:logic>
  
  
  

Mime
View raw message