"Quinton McCombs" <[EMAIL PROTECTED]> writes:

>Does anyone know why org.apache.turbine.util.mail.MultiPartEmail has a
>dependancy on Torque???  Is this really supposed to be the Criteria
>object from Torque?

Yes. It's historic and one of the few places left which abuses Criteria.

Basically it needs an "object to hold a few parameters".

It's an abuse and I'd like to see it go. Ideally, decoupled turbine
should compile without Torque.

        Regards
                Henning



>    /**
>     * Constructor used to initialize attributes.
>     *
>     * <p>This method uses the criteria object to set the different
>     * fields of the e-mail. The expected fields of the Criteria are:
>     *
>     * <ul>
>     * <li>SENDER_EMAIL</li>
>     * <li>RECEIVER_EMAIL</li>
>     * <li>EMAIL_SUBJECT</li>
>     * <li>EMAIL_BODY</li>
>     * <li>ATTACHMENTS - A Vector of EmailAttachment.</li>
>     * <li>FILE_SERVER - Where the files are located.  If not given,
>     * they are assumed to be local.</li>
>     * </ul>
>     *
>     * Deprecated, since Criteria is deprecated in mail API.
>     *
>     * @param criteria A Criteria.
>     * @exception MessagingException.
>     */
>    public MultiPartEmail(Criteria criteria)
>        throws MessagingException
>    {
>        this.init();
>        this.initCriteria(criteria);
>    }

>    /**
>     * Uses the criteria to set the fields.
>     *
>     * <p>This method uses the criteria object to set the different
>     * fields of the e-mail.  The expected fields of the Criteria are:
>     *
>     * <ul>
>     * <li>SENDER_EMAIL</li>
>     * <li>RECEIVER_EMAIL</li>
>     * <li>EMAIL_SUBJECT</li>
>     * <li>EMAIL_BODY</li>
>     * <li>ATTACHMENTS - A Vector of EmailAttachment.</li>
>     * <li>FILE_SERVER - Where the files are located.  If not given,
>     * they are assumed to be local.</li>
>     * </ul>
>     *
>     * Deprecated, since the Criteria is deprecated.
>     *
>     * @param criteria A Criteria.
>     * @exception MessagingException.
>     */
>    protected void initCriteria( Criteria criteria )
>        throws MessagingException
>    {
>        super.initCriteria(criteria);

>        if (criteria.containsKey(EMAIL_BODY))
>        {
>            setMsg(criteria.getString(EMAIL_BODY));
>        }
>        else
>        {
>            setMsg("NO MESSAGE");
>        }

>        Vector attachments;

>        if (criteria.containsKey(ATTACHMENTS))
>        {
>            attachments = (Vector) criteria.get(ATTACHMENTS);
>        }
>        else
>        {
>            attachments = new Vector();
>        }

>        if (criteria.containsKey(FILE_SERVER))
>        {
>            fileServer = criteria.getString(FILE_SERVER);
>        }

>        for (int i = 0; i < attachments.size(); i++)
>        {
>            EmailAttachment attachment =
>                (EmailAttachment) attachments.elementAt(i);
>            attach(attachment);
>        }
>    }

>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to