Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Drag & Drop email from outlook to Swing

Thread view: 
rdeman@gmail.com - 20 Aug 2006 23:31 GMT
Hello all,

I would like to manage the drag & drop of an email from outlook to a
Swing application.

I have tryed the following code:
Transferable tr = dropTargetDropEvent.getTransferable();
if (tr.isDataFlavorSupported(DataFlavor.stringFlavor)) {
   dropTargetDropEvent.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
   String string = (String)
tr.getTransferData(DataFlavor.stringFlavor);

But this only gives me the displayed fields of the email in outlook
(from, to, subject and size) but not the body.

What I would like to do is to write an msg file on the file system
(exactly as when you drop the mail into the windows explorer) and index
it in lucene.
I would also be happy if I could get an id of the email that I can use
afterwards to access it through a dedicated API (like moyosoft although
it is commercial).

Any help would be appreciated
Thank you in advance
alexr - 21 Aug 2006 00:48 GMT
> Hello all,
>
[quoted text clipped - 20 lines]
> Any help would be appreciated
> Thank you in advance

I would start with taking a look at all of the available flavors of
this same data, and finding one that fits your requirements best.

Hope this is of help.

www.jdbcpersistence.org Fast ORM solution
rdeman@gmail.com - 21 Aug 2006 09:45 GMT
tr.getTransferDataFlavors() returns me a list of 27 flavors:
flavor=java.awt.datatransfer.DataFlavor[mimetype=application/x-java-serialized-object;representationclass=java.lang.String]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.Reader]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.lang.String]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.CharBuffer]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[C]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-8]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-8]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-8]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16BE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16BE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16LE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16LE]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=unicode]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=Cp1252]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=Cp1252]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=Cp1252]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=ISO-8859-1]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=ISO-8859-1]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=US-ASCII]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=US-ASCII]
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=US-ASCII]

tr.getTransferData(flavor) for each of them always contain the same
information : the displayed fields of the email
I don't know how to manage flavors "representationclass=[C]"
"representationclass=[B;..."

> > Hello all,
> >
[quoted text clipped - 27 lines]
>
> www.jdbcpersistence.org Fast ORM solution
alexr - 21 Aug 2006 15:54 GMT
My guess is that B
flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-8]
stands for BODY
Cheers,
> tr.getTransferDataFlavors() returns me a list of 27 flavors:
> flavor=java.awt.datatransfer.DataFlavor[mimetype=application/x-java-serialized-object;representationclass=java.lang.String]
[quoted text clipped - 61 lines]
> >
> > www.jdbcpersistence.org Fast ORM solution
rdeman@gmail.com - 22 Aug 2006 09:03 GMT
> My guess is that B
> flavor=java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-8]
[quoted text clipped - 65 lines]
> > >
> > > www.jdbcpersistence.org Fast ORM solution

in fact, [C stands for char[] and [B for byte[]. But they still only
contain the message fields, but not the body.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.