OpenOffice use .odm programmatically in Java - java

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.

Related

View 3D STEP .stp CAD model in GWT based web application

I am trying to make a GWT based web application which will be able to show 3D model from PTC Creo's .stp (STEP file). I am programming in Eclipse.
I started with Parallax3D framework, and I am able to make simple objects. But I'm stuck with how to parse the .stp file and make objects from that.
Later I saw that there is plenty of other tools for 3D on Web. There are "gwt-g3d", "gwtgl", "gwto3d",....
I also found JSDAI API, which should be able to parse .stp files. With very limited examples I couldn't manage to do anything usefull.
I am lost with all those things. Which path should I take?
Has anyone done that before OR is there a simpler opensource solution for that?
Thank you.
You could use the NIST STEP File Analyzer (free but not open source) to convert the STEP file to VRML/X3D. Three.js based frameworks can then view the VRML/X3D. If you want a completely open source solution, you need something to transform the STEP file, which often contains NURBS trimming that three.js lacks, to a tesselated form. FreeCAD, pythonOCC, node-occ or the underlying OpenCasCade can transform STEP to a mesh form.

How can I create an Apple Keynote Presentation from scratch?

I am trying to write a program that creates an Apple Keynote Slide. I was hoping to find some answers about creating apple's xml format (apxl) from scratch using Java. I have found a few documents pertaining to older versions of Keynote that allow such creation using Java DOM, but as far as the latest version of Keynote goes, I haven't had much luck. (btw I know that the .key file is a package, and that the apxl file is compressed .gz)
I have already read the following documents:
[1] https://developer.apple.com/appleapplications/keynote-apxl.html
[2] http://www.xml.com/pub/a/2004/01/07/keynote.html
... and many others. (stackoverflow will only let me post two links as a new person)
A google search will show you that there's not much documentation past 2004.
My question is, has anyone here successfully written something in Java to create, or add to, an apxl file for use with keynote? If so, could you point me toward the documentation, tutorials, or sample code that you used?
I'm not looking for your code, I just can't find a viable set of instructions wherever I look.
Thanks
My colleague used the next approach to generate big MS .xls/.doc 2003 documents. He had a goal to make reports contained >10^6 rows. He just produced xml and made zip file - as does it MS Word/Excel.
The format of xml can be simply retrieved from sample documents: e.g. if you'd like to know how do text formatting - just create simple documents with it and analyse output files.
Of couse we had very tiny set of abilities, but basic text formatting and layout markups were implemented.
I'm not sure how many features do you need. But you may implement the same xml generation procedures after separate investigation of every formatting feature.

Generating CCD document using MDHT API

I am trying to use MDHT API to generate CCD documents. I am doing this in the following way.
Downloaded Java runtime libraries and placed them in classpath and writing code to generate all the sections using MDHT API.
Writing code for each section is taking long (a bit complicated). I was wondering if I am missing anything. Is there any open source mdht GUI that generates code for each section or am I moving in the right direction?
I am currently stuck at Medications Section/Immunization Section. Can anyone please redirect me to any examples/tutorials related to each section. I have already looked at user guide/developers guide.
Any help is appreciated.
I think MDHT API will only provide a Model for the CCD document.
if it contains any default implimentaion to generate CCD document,,i dont know..
any way better you just generate the XML in DOM,STAXs API.
CCD example link
Another better API that i found is MIRTH
follow the link
Mirth User guide
The best place to look for help/sample code is the developers forum: Eclipse Community Forums ยป Model Driven Health Tools.
You may need to create a (free) account to get access.
You could also go to the forums to post your specific MedicationsSection/immunization question for a possible specific answer.
Another good site is CDA tools: MDHT Developers Guide. Look at Produce CDA Content using MDHT API.
There are countless examples of building documents in the test code projects.
Download the All In One (MDHT_CDATools) from GitHub linked in the MDHT project site and look at the code in the test projects such as: org.openhealthtools.mdht.cda.consol.example
The closest (current) thing to a GUI based document building application in MDHT would be using the all in one to modify the existing models and generate sample snippets/documents that way (or creating a model from scratch, which includes only what you need). If you wanted the entire document produced in XML, you could then generate the instance from GeneralHeaderConstraints as opposed to any of the many child templates (which would give you snippets). Either way, this is not really the intention of the model interface (it's more for conformance) and would take you far longer to implement than using the API itself - which accesses the models which already exist in order to auto-generate conformant content quickly.

Examples of implementing Java Document model

Does anyone have any real life use cases where someone had to make a non-trivial implementation of the Java Document interface?
I'm looking for descriptions of the real use case, not examples of code, and not tutorials.
I did a little work for an open source MMO game known as HackWars. As part of the game I implemented an in-game chat system that ran as in InternalJFrame inside the main client. I used Document in conjunction with a JTextPane so that I could insert strings and use different fonts for different users within the same JTextPane.
The project source is hosted here: https://www.assembla.com/code/hackwars/git/nodes
The chat code starts here: https://www.assembla.com/code/hackwars/git/nodes/HWTomcatServer/webapps/ROOT/WEB-INF/classes/HWChat
The specific file I used Document in was HWChat.client.chatPane which you can see the source code for here: https://www.assembla.com/code/hackwars/git/nodes/HWTomcatServer/webapps/ROOT/WEB-INF/classes/HWChat/client/chatPane.java
As part of a Java IDE I implemented an editor kit for Java source text. The document handled things like balancing brackets and quotes and auto-indenting, and also kicked off the incremental compilation process.

Drag and Drop an Email from MS Outlook to Eclipse RCP

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.

Categories

Resources