You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Quinton McCombs <qm...@nequalsone.com> on 2003/02/06 19:56:20 UTC

MultiPartMail has dependancy on Torque?????

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?

    /**
     * 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: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: MultiPartMail has dependancy on Torque?????

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Henning P. Schmiedehausen" <hp...@intermeta.de> writes:

> "Quinton McCombs" <qm...@nequalsone.com> 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.

+1!
-- 

Daniel Rall <dl...@finemaltcoding.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: MultiPartMail has dependancy on Torque?????

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Quinton McCombs" <qm...@nequalsone.com> 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: turbine-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: MultiPartMail has dependancy on Torque?????

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Gross!  Not sure.  You could take a gander at the Commons Mail package
which Jon factored out of T2 for T3 and see what it looks like there.

"Quinton McCombs" <qm...@nequalsone.com> 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?
> 
>     /**
>      * 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: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 

-- 

Daniel Rall <dl...@finemaltcoding.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org