I am attempting to parse .wab files using java. Upon inspection the files look encoded because when you open them in note it just looks like garbage. The only way I have found to parse this data is to actually import it using Microsoft Outlook.
Is there an API that can be used in java to parse out this data? Or does anyone know how to go about parsing a .wab file?
Using COM from Java in combination with this free (LGPL) component http://www.nektra.com/products/nktwab-outlook-express-windows-mail-wab-api/ should allow for doing what you ask...
Another option is to use libwab from Java - see http://www.filewut.com/spages/page.php/software/libwab
Related
I'm looking for some info on how to create a .vsdx file in Java without any commercial libraries. According to other questions it seems to be pretty tough.
As a source we have a different, probably unknown file format called .epml that contains graphical information of EPCs which we should be able to convert to a .xml file. As far as I understand the .vsdx format so far, that's one of many files in the unzipped .vsdx required. I'd be glad if anyone could tell me about my options how to implement/create all the other files.
EDIT: The goal here is to be able to convert the graphic information of the .epml file so Visio is able to read & display it as in the source. Therefore, it doesn't have to be a .vsdx file if there are other possible options.
Thanks!
EPML is a not an unknown format, it is an interchange format for EPC tools. Just try to google it :)
I would suggest you convert your .epml files to .svg (there are free open source converters available, like epml2svg). Visio can read and show .svg files. Means - writing code does not seem to be required to achieve your goal (to convert .epml files to something Visio can show). AFAR there is online version of the tool as well - you upload EPML file, get back SVG, and just open it in Visio - that's it.
Side note - there are companies, like bpm-x for example, specializing in BPM tool-to-tool diagram conversion. Maybe they already have a solution for your original tool.
The .VSDX file is "office xml" format, that is also open and documented. But it's pretty tough to generate file from scratch, you are right. So in principle you could start with any code that is capable of handling open xml packages. Microsoft has OpenXML SDK, but that's .NET (MSDN HOWTO assumes you are using .NET, but explains basics of what the open xml package consists of)
AFAIK, for java, there are no open source visio libraries you could use. Java and Visio seem to live in parallel universes. The only viable commercial option I've heard of seem to be Aspose.
Interesting - whilst I cannot give a final answer, here are some thoughts:
Question 1: Why would you want to avoid commercial tools, when the final result file will require some - namely "Visio"?
1) Creating Visio files from XML:
Create template XMLs from a VSDX. Identify the files, that you need to edit. From what I've seen, these should be the masters and the pages files. Being able to make an XML from EPML, you should also know how to adapt it to a new structure.
This solution is probably by far the most tedious and less flexible.
2) Use Visio automation:
Presuming that the final document will need more than just graphics, namely shape data as well, an easier solution would consist of creating the graphics first
a) as SVG and import into Visio
b) even easier - automated drawing by Visio's automation capabilities (VBA, .Net, ...). The shapes to drop would already have been prepared as masters will all the relevant data and behaviour settings.
Then you would populate the data by means of one of the many data linking features (Wizard, Standard data linking, ODBC connections, etc.)
I'm developing an application where I've requested data from an external institution's website. They have informed me that the data will be provided by OAI-PMH.
Could someone show me some sample code in Java how data is extracted from a OAI-PMH ?
I wonder how different it is from reading and parsing XML data.
Thank you.
Warmest wishes,
Shoubhik
For a Java implementation, for example, you could use some already existent library, like XOAI with an easy to use API. There are some provided samples.
To extract metadata from each Record you could use a XML Parser or a XML bind approach (JAXB). For other languages, like PHP and Perl there are also other alternatives.
I am able to create .mpx file by using mpxj library in java.
I need write ( create ) .mpp file in java can any one suggest me please.
I maintain MPXJ, and the short answer to your enquiry is that, at present, MPXJ does not write MPP files.
The main reason for this is simply that despite the effort which has gone into understanding the MPP file structure, there is still a great deal of it which is not well understood, hence it is difficult to reliably generate. The other issue is that even if I was to produce some code which could generate an MPP file, the features it could write to that file are likely to lag behind what MPXJ supports in the MSPDI file format, again due to my incomplete understanding of the MPP format.
My suspicion is that the next version of MS project (project 15? Project 2013?) may probably offer a ".mppx" file format, similar to the ".docx" etc formats used by other applications in the MS Office suite. This will be XML-based and will be more straightforward to generate than the binary MPP file format currently is... let's see what Microsoft come up with!
Jon
Visit http://www.mpxj.org/faq/
Can I use MPXJ to write MPP files?
Not at present. Although it is technically feasible to generate an MPP file, the knowledge we have of the file structure is still relatively incomplete, despite the amount of data we are able to correctly extract. It is therefore likely to take a considerable amount of development effort to make this work, and it is conceivable that we will not be ablet to write the full set of attributes that MPXJ supports back into the MPP file - simply because we don't understand the format well enough. You are therefore probably better off using MSPDI which does support the full range of data items present in an MPP file.
You can
Try this: http://www.aspose.com/java/project-management-component.aspx
It writes MPP and Microsoft Project XML.
But this not free
Try this: http://www.aspose.com/java/project-management-component.aspx
It writes MPP and Microsoft Project XML.
I think by "mpp" you probably mean "Microsoft PowerPoint", correct?
Q: Why do you think MPXJ (Microsoft Project Exchange/Java) can't do this?
http://www.mpxj.org/
Welcome to MPXJ! This library provides a set of facilities to allow
project information to be manipulated in Java and .Net. MPXJ supports
a range of data formats: Microsoft Project Exchange (MPX), Microsoft
Project (MPP,MPT), Microsoft Project Data Interchange (MSPDI XML),
Microsoft Project Database (MPD), Planner (XML), Primavera (PM XML,
XER, and database), and Asta Powerproject (PP, MDB).
I have a word file () which has many text fields and a startup macro, which, when word file is opened sets, values to fields from file properties ?!
So basically, I need API that can convert MS word (MS Office XP) to PDF. It would be great if API had a startMacro function(), but I know that is not gonna happen.
I have tried Apache POI, but there is so little support to old word format.
Also I read about OO API, but I'm not able to have an OO instance running on the server.
I worked on a similar problem a year ago. I finally settled with using OpenOffice.org I'm not positive OpenOffice.org will meet your exact needs here, but I would suggest looking at it.
Can you run OpenOffice on another host (that your server can reach)? If so, you can use the OpenOffice api to open a socket to that other host to do the conversion. Docmosis is a Java library that provides an API for populating DOC and ODT files and having the formats converted. It still relies on OpenOffice being installed somewhere that your server can reach, but you don't have to configure much else.
If your documents were a newer format (Doc-xml) then you could process them directly from Java with XML, but it would be a pretty big learning curve.
If its just a single Word file, why don't you convert it to docx, and then use docx4j (or POI)?
If you need to convert on demand, you could use http://code.google.com/p/jodconverter/ (on another server, if you aren't allowed OO on your server).
I have a set of complex Excel files (with figures in it) that I want to show in a web browser. So I need to convert them into HTML page first. Since the excel files are very complex, I can not just parse them and generate a HTML table with HTML tags. The current manual solution that works fine is when I use Microsoft Excel software to save the spreadsheet as a HTML page. I want to automate this task in some way since I want to do it progrmatically through Java. Is their any existing solution or a way to do it? Thanks.
EDIT - I was able to create a macro for it but could not figure it out that how can I execute a macro on excel file from a Java program. Does somebody know?
If open office does a good job of the export then you could take a look at the source to see how it does it. OO is a combination of Java and C++ I believe so you might get lucky and find a Java solution.
Otherwise, I would try and use Excel itself to do the export and find some way of calling it programmatically. If you go down this path you'd be better of using a Microsoft stack (C# would be the most similar to Java) as I would expect it to have all the functions you need already defined.
You might look into POI:
http://poi.apache.org/
I think your best bet is to call Excel from Java using JACOB
Creating direct COM calls (which is what you'll be doing from JACOB) is a bit tough, but you'll get the hang of it. I can't imagine that the Excel VBA macro is horribly complicated. Take a look at the sample code (Usage and Documentation) in the JACOB link for what this will look like.
One other thing: Remember to explicitly clear references. JACOB will release COM handles when objects are garbage collected, but if you are doing any sort of high performance work, you will want to close those connections as quickly as possible. We generally write all of our COM code in a series of try/finally statements - the code is messy, but robust.
Try using hypernumbers. (Disclaimer, I'm the CEO)
I ended up using the Scribd API. I uploaded the document to their server through their API in realtime and pasted an iframe with a link in it which is returned by Scribd.