views:

59

answers:

0

I want to create a flowchart in OpenOffice Draw.

Since there's a lot of steps to show (and may change in future) but I can extract the data, I want to automate the creation with the following steps:

  • Create a new ODG document with specified page settings.
  • Insert flow chart shapes with specified properties.
  • Connect those things with arrows.
  • Ideally, auto-organise things into sensible positions.

I don't want to spend hours reading about some "UNO" thing - I just want code examples that I can adapt as required.

Not bothered if the example code uses the OO API, or just modify XML files inside a zipped template - so long as it lets me do the above things easily enough.

I'm doing this with Railo (CFML), but I can also work with Java, or convert snippets from other readable languages.

Any suggestions how to go about this?


Update:
I've started playing with the XML route - I saved an empty file, and a file with a single object, and compared the two (treating as zips) to see the difference, then repeated a few times with different changes to help understand what's going on.

I have some very basic (and incomplete) code which can create shapes and connect them, which can be seen here: http://gist.github.com/634306

It's very crude, but I can probably work out a way to use what I've got now to produce what I need - but I'm still hoping that someone can point me towards a better way of doing this - particularly since I'll need to figure out some way of positioning the shapes appropriately, which wont be trivial.

I've created a distinct question for this fourth point:
http://stackoverflow.com/questions/3970366/how-do-i-auto-layout-boxes-on-a-flowchart

Update 2:
From that other question, I have discovered GraphViz which can visualise graphs from data - and I've created a 'digraph' from my data - so all I need is a way to convert the output of GraphViz into something which OpenOffice Draw can accept. The obvious thought there would be SVG, but it seems OpenOffice hasn't implemented SVG properly yet, so I need to come up with another plan.