Has anyone got a working solution without some Java/COM-bridge? E.g. process the Email as a file (.msg) rather than locating the data that is referenced in the Clipboard?
Maybe this is a solution for your problem:
http://sourceforge.net/projects/javaoutlookdd/
It allows to handle outlook items like File objects during drag&drop.
I did make some headway on this sort of thing a few years back using Apache POI to extract the contents of an email from .msg files. I'm pretty sure they have a simple swing explorer / viewer that you can use to examine the structure within the compound document format, but I can't find it right now.
I was able to extract most information that I was interested in but was ultimately wanting to create a mime format version of the message and couldn't extract all the information I needed in a format I could use.
I assume that you've already ruled out the tools in "org.eclipse.swt.dnd" for some reason? There are some examples here on how to go about using them, in case you haven't. If what you really want to do is drag&drop, you're going to have to do some work with those tools. At that point, really the question becomes, what format is it in on the clipboard, vs in a file, and which is easier to integrate into your app.
Related
To add to the title: I now have a working workflow consinsting of two steps.
1) I extract the HTML Search Result pages for every keyword given in a input.txt file. - e.g.:
SAP;
Business Intelligence;
Talend saved those results and writes them as HTML to keywords_SAP.txt and keywords_Business Intelligence.txt. Attached is an image of the talend job.
2) I use Java Code to import these files (one by one) - Parse the Data out of the DOM Structure using the JSoup Library. Straigt away, the data gets written into a MySQL Database.
Here is my problem: It all works fine for now, but the requirement is to completely automate the process in the future, so it can run on a server periodically.
Therefore I thought to include my Java Code in Talend - which got my stuck, because I wasn't able to import the mysql connector and the jsoup.jar.
Where I need your help is either to advise me how to connect to my existing Talend workflow - or you are maybe thinking of an easier solution, which I'm just not thinking of right now.
I have to add, I'm quite new to coding, and it was a big leap to come this far with parsing and writing into a DB. With your help throughout the process, I got more comfortable though. I hope you can help me solve this problem. Thank you in advance for your time spent.
This can be done by using the tLoadLibrary component and putting the external jar file in <talendInstallDir>/lib/java
You can use the onSubJobOk or onComponentOK connections to connect to the next components.
Your tLibraryLoad component(s) should be first thing you do in your job.
You can also import classes/methods in tJava, tJavaRow under Advanced Properties in the component view and then use something like:
import org.apache.commons.lang3.math.NumberUtils;
to import the specific class you need (in this case, the Apache Commons NumberUtils).
you can use tLoadLibrary into you flow and remember use OnSubjobOk you should use your tJava code.
Although this thread is 2 years old and you might have already solved this problem., I recently did a similar mini-project and this may help you. I am using plain string manipulation instead of JSoup library. Also has an associate video of step by step instructions. Hope it helps.
Talend project to parse webpage
I've searched and searched, coming across questions that address parts of the problem, but nothing comprehensive. I'm using GWT and eclipse to develop a website that uses highcharts to make some fancy plots.
The idea is that the user will be able to select one of their local data files of type csv and upon selection of the file, the plot will be rendered using their data and our fancy algorithms.
We don't want to send enormous amounts of data to the server as this will become costly and time consuming for the user. Is there a way to process or at least pre-process the user's data using Java code to be implemented in a GWT-eclipse project?
Any help is greatly appreciated!
This is a duplicate of GWT Toolkit: preprocessing files on client side
One of the answers points to these links:
http://code.google.com/p/gwt-nes-port/wiki/FileAPI - GWT wrapper for HTML5 File API
http://www.html5rocks.com/en/tutorials/file/dndfiles/ - HTML5 FileAPI
But, alas, the FileAPI is pretty new: http://caniuse.com/fileapi
The other alternative you have, to avoid server, is a text area to paste the CSV file into, then read that using GWT. This is a common trick and I think you can even copy+paste from certain spreadsheet programs this way.
You cannot do it in a universal way in GWT in all browsers currently. GWT translates to javascript and it does not have the required privileges to process client side the files.
For more detailed answer you can reference - How to retrieve file from GWT FileUpload component?
I have a application which is created on ZK Framework , i want to give user a functionality where user can open a saved file in edit mode and then again saved the changed in database can any one know which API can help me to do this?
You could use Google Apps to do so and set Google Docs to edit your DOC, PDF or even XLS extension files. For more help on setting it up, feel free to ask again. :)
The problem you're posing doesn't have a simple answer, unfortunately.
There are two general approaches you could take..
The low hanging fruit is to provide an interface for the user to download a file and upload it after they make edits using whichever editing software they choose / is appropriate.
The other approach would be to provide a GUI to edit files. Regardless of the web framework you are using, this is a daunting task to say the least. As #userRandom mentioned, this is a large part of what Google Drive (formerly Google Docs) is attempting to solve.. but even Google's solution is not perfect and very much a work in progress.
I would strongly suggest evaluating the scope of your project before proceeding.
If you choose to move forward, consider a simple solution that works for .txt files. Then, consider how you might handle .doc files. Then, PDF files, XLS files, etc.
Folks here will be able to answer specific questions.
I need to do some work on a Master Document (.odm) with the UNO IDL and it's binding to Java.
I want to know if there is a way to access all the documents it's referencing and, if possible, without extracting the content.xml.
What I managed to do so far is to open the document as a XComponent, to open it's XTextDocument interface (and to extract the text belonging to the document but not the one from the included documents). And I'm unable to gather some useful information from that.
Is there an interface that could help? Or some other stuff?
You might want to look into the ODF Toolkit, since the easier parts are Java-based.
The ODF Toolkit project is currently moving to an Apache incubator project.
The current site is here: http://odftoolkit.org/
The new project is at http://incubator.apache.org/odftoolkit/
On the other hand, extracting the content.xml of the .odm might be a better way to go. There is probably some XSLT magic you can use to locate the references to the separate parts.
Also, when you open the master document in an OpenOffice.org consumer, doesn't it show clues about how the constituent documents are found? The one time I messed with this, I noticed that the components had software-generated names that were pretty obvious.
I want to know how to convert html file to image. How do I do this?
You can checkout the source code for the popular BrowserShots service,
http://browsershots.org/
If you're running Windows, and have the GD library installed, you can use imagegrabwindow. I've never used it myself, but as always, the PHP site has lots of documentation and examples.
Use:
WKHTMLTOPDF.
It also has binding to PHP, or you can run it yourself from command line.
Problem is that you need to implement all the functionality of a browser and an HTTP stack (and this still does not deal with the case where the content is modified using javascript).
As John McCollum says, if you've got the website open in a browser on your PC, then you can use imagegrabwindow or snapsIE (MSIE only)
If you want to to be able to get a snapshot using code only, then you might want to look at one of the off the shelf solutions - AFAIK there are several programs (at least 2 of which are called html2pdf) which will generate a PDF of static html - and its relatively easy using standard tools to trim this to window size and convert to an image file.
e.g. https://metacpan.org/pod/distribution/PDF-FromHTML/script/html2pdf.pl