java.lang.Object
org.chiba.xml.xforms.connector.AbstractConnector
org.chiba.connectors.smtp.SMTPSubmissionDriver
- All Implemented Interfaces:
- org.chiba.xml.xforms.connector.Connector, org.chiba.xml.xforms.connector.SubmissionDriver
- public class SMTPSubmissionDriver
- extends org.chiba.xml.xforms.connector.AbstractConnector
- implements org.chiba.xml.xforms.connector.SubmissionDriver
The SMTP submission driver serializes and submits instance data over SMTP
(internet mail).
Currently, the driver only supports the post submission method
and the replace mode none. Support for form-data-post
and urlencoded-post as suggested in
11.2 Submission Options
is on the way.
The driver requires the additional information about the SMTP server to
use, the mail subject, and the sender. This information has to be provided
in the query part of the submission's action URI. If you want
the driver to authenticate a user with the SMTP server, just provide a
username and a password. Support for other mail
header fields like cc may be added later.
Be careful when writing the submission's action URI: First,
the contents of the query part have to be URL-encoded, then you have to
replace all &'s with their corresponding XML entity
& in order to keep the XML well-formed.
Here is an illustrating example:
<xforms:submission id='smtp' xforms:action='mailto:nn@nowhere.no?server=smtp.nowhere.no&sender=xforms@nowhere.no&subject=instance%20data' />
The same example enforcing authentication:
<xforms:submission id='smtp-auth' xforms:action='mailto:nn@nowhere.no?server=smtp.nowhere.no&sender=xforms@nowhere.no&subject=instance%20data&username=xforms&password=shhh' />
Since mail accounts are personal data, there is no example form demonstrating
SMTP submission.
- Version:
- $Id: SMTPSubmissionDriver.java,v 1.5 2003/09/08 12:48:25 joernt Exp $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.chiba.xml.xforms.connector.Connector |
setURI |
LOGGER
private static final org.apache.log4j.Category LOGGER
- The logger.
SMTPSubmissionDriver
public SMTPSubmissionDriver()
submit
public java.util.Map submit(org.chiba.xml.xforms.Submission submission,
org.w3c.dom.Node instance)
throws org.chiba.xml.xforms.exception.XFormsException
- Serializes and submits the given instance data over the
mailto protocol.
- Specified by:
submit in interface org.chiba.xml.xforms.connector.SubmissionDriver
send
private void send(org.chiba.xml.xforms.Submission submission,
org.w3c.dom.Node instance)
throws java.lang.Exception