dims        01/09/19 09:08:09

  Modified:    src/org/apache/cocoon/acting Tag: cocoon_20_branch
                        SendmailAction.java
               src/org/apache/cocoon/components/language/markup/xsp Tag:
                        cocoon_20_branch XSPRequestHelper.java
               src/org/apache/cocoon/components/language/markup/xsp/java
                        Tag: cocoon_20_branch request.xsl
  Log:
  Patches from "Klaus Bertram" <[EMAIL PROTECTED]> for
  - Extend xsp-request with get-attribute-names
  - Fix for sendmailAction.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.4   +7 -8      xml-cocoon2/src/org/apache/cocoon/acting/SendmailAction.java
  
  Index: SendmailAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/SendmailAction.java,v
  retrieving revision 1.3.2.3
  retrieving revision 1.3.2.4
  diff -u -r1.3.2.3 -r1.3.2.4
  --- SendmailAction.java       2001/08/24 12:46:17     1.3.2.3
  +++ SendmailAction.java       2001/09/19 16:08:09     1.3.2.4
  @@ -7,13 +7,6 @@
    *****************************************************************************/
   package org.apache.cocoon.acting;
   
  -import javax.mail.Message;
  -import javax.mail.Transport;
  -import javax.mail.Session;
  -import javax.mail.internet.InternetAddress;
  -import javax.mail.internet.MimeMessage;
  -import javax.mail.internet.AddressException;
  -
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.parameters.Parameters;
  @@ -23,6 +16,12 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.SourceResolver;
   
  +import javax.mail.Message;
  +import javax.mail.Session;
  +import javax.mail.Transport;
  +import javax.mail.internet.AddressException;
  +import javax.mail.internet.InternetAddress;
  +import javax.mail.internet.MimeMessage;
   import java.util.Collections;
   import java.util.Date;
   import java.util.HashMap;
  @@ -80,7 +79,7 @@
           properties.put("mail.smtp.host",parameters.getParameter("smtphost",null));
           getLogger().debug("SendmailAction: overriding default smtp server, using 
"+properties.get("mail.smtp.host"));
         }
  -      Session session = Session.getDefaultInstance(properties);
  +      Session session = Session.getDefaultInstance(properties,null);
         Message message = new MimeMessage(session);
         String from = null;
         String to = null;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.4   +26 -1     
xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java
  
  Index: XSPRequestHelper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java,v
  retrieving revision 1.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- XSPRequestHelper.java     2001/08/20 14:07:27     1.5.2.3
  +++ XSPRequestHelper.java     2001/09/19 16:08:09     1.5.2.4
  @@ -23,7 +23,7 @@
    * The <code>Request</code> object helper
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ricardo Rocha</a>
  - * @version CVS $Revision: 1.5.2.3 $ $Date: 2001/08/20 14:07:27 $
  + * @version CVS $Revision: 1.5.2.4 $ $Date: 2001/09/19 16:08:09 $
    */
   public class XSPRequestHelper {
     /**
  @@ -366,6 +366,31 @@
       return request.getAttribute(name);
     }
   
  +     /**
  +   * Output attribute names for a given request
  +   *
  +   * @param objectModel The Map objectModel
  +   * @param contentHandler The SAX content handler
  +   * @exception SAXException If a SAX error occurs
  +   */
  +  public static void getAttributeNames(
  +    Map objectModel,
  +    ContentHandler contentHandler
  +  )
  +    throws SAXException
  +  {
  +    Request request = (Request)objectModel.get(Constants.REQUEST_OBJECT);
  +    XSPObjectHelper.start(URI, PREFIX, contentHandler, "attribute-names");
  +
  +    Enumeration e = request.getAttributeNames();
  +    while (e.hasMoreElements()) {
  +      String name = (String) e.nextElement();
  +      XSPObjectHelper.elementData(URI, PREFIX, contentHandler, "name", name);
  +    }
  +
  +    XSPObjectHelper.end(URI, PREFIX, contentHandler, "attribute-names");
  +  }
  +     
     /**
      * Set the specified attribute
      *
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +6 -1      
xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl
  
  Index: request.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- request.xsl       2001/08/14 13:59:23     1.3.2.1
  +++ request.xsl       2001/09/19 16:08:09     1.3.2.2
  @@ -11,7 +11,7 @@
   
   <!--
    * @author <a href="mailto:[EMAIL PROTECTED]>Ricardo Rocha</a>
  - * @version CVS $Revision: 1.3.2.1 $ $Date: 2001/08/14 13:59:23 $
  + * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/09/19 16:08:09 $
   -->
   
   <!-- XSP Request logicsheet for the Java language -->
  @@ -225,6 +225,11 @@
           </xsp:element>
         </xsl:when>
       </xsl:choose>
  +  </xsl:template>
  +     <xsl:template match="xsp-request:get-attribute-names">
  +     <xsp:logic>
  +        XSPRequestHelper.getAttributeNames(objectModel, this.contentHandler);
  +     </xsp:logic>
     </xsl:template>
   
     <xsl:template match="xsp-request:remove-attribute">
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to