org.apache.cocoon.generation
Class IMAPGenerator

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.generation.AbstractGenerator
              extended byorg.apache.cocoon.generation.IMAPGenerator
All Implemented Interfaces:
org.apache.cocoon.generation.Generator, Poolable, Recyclable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.xml.XMLProducer

public class IMAPGenerator
extends org.apache.cocoon.generation.AbstractGenerator

Generates an XML listing of messages from an IMAP mail server.

You must configure this generator with "host", "user", and "pass" parameters which specifies the mail server host, the user to login as, and the password to use, respectively. Beware that these passwords will be sent cleartext since the Generator does not use an SSL-enabled IMAP connection.

Also beware that storing sensitive data, (such as mail usernames and passwords) can be very dangerous, so please be very careful in the method by which you send the user and password parameters to the generator.

Instructions: get the JavaMail API jar from http://java.sun.com/products/javamail/, and the JAF activation.jar from http://java.sun.com/beans/glasgow/jaf.html. Put mail.jar and activation.jar in xml-cocoon2/lib/local/, and recompile. These jars could actually be moved to lib/optional and added to jars.xml in the future.
TODO Refactor all of this to use the MailCommandManager, etc...

Version:
$Id: IMAPGenerator.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
IMAPGenerator()
           
 
Method Summary
 void generate()
           
 void recycle()
          Recycle the generator by removing references
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, Parameters par)
           
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Constructor Detail

IMAPGenerator

public IMAPGenerator()
Method Detail

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters par)
           throws org.apache.cocoon.ProcessingException,
                  SAXException,
                  IOException
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException

generate

public void generate()
              throws SAXException,
                     org.apache.cocoon.ProcessingException
Throws:
SAXException
org.apache.cocoon.ProcessingException

recycle

public void recycle()
Recycle the generator by removing references



Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.