SQL Power Business Intelligence Productivity Tools

SQL Power Software Forum

SQL Power Software Forum

  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page  [Register] Register /  [Login] Login 
Integrating with a non-database schema  XML
Forum Index » SQL Power Architect Discussion
Author Message
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

I have a set of metadata from a non-RDBMS source that is equivalent to a schema with tables and columns. Currently the metadata exists in text files. It would be really useful to be able to represent it with an ERD but given there are thousands of elements I'd rather not enter them all manually!! Does anyone have any thoughts on how to get the model into Power*Architect (without creating a database equivalent schema that is)
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

If they are arranged as ASCII files with one file per "table," you may have success with the csvjdbc driver. As far as I am aware, nobody has tried to do this in the Architect before--you'd be breaking new ground.

If you're interested in trying it out, we will try to support you here in the interest of seeing if such a thing is possible.

-Jonathan
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

Oh, something else to consider:

If you paste a multi-line string into the playpen, the Architect will create one table per line of text. Then if you paste a multi-line string into a table, the Architect will create one column in that table per line of text. This is probably the easiest way to achieve what you want to do.

-Jonathan
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

Thanks for the ideas. Right now the meta data is in a two text files, one with 'table' names/descriptions and one with 'column' definitions. Thinking about your first option, I could parse the files and reformat to work with csvjdbc but then I wonder if I have to reformat and write everything to a file, woul it be possible to output a .architect file and save some time
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

Actually, it sounds like the multi-line copy/paste feature is a perfect fit for this situation.

If you're thinking of programmatically generating a model from these two files, I agree you'd be better off going straight to an Architect format, because I'm not sure if csvjdbc implements enough of the JDBC DatabaseMetaData for the Architect to do a reasonable job reverse engineering it.

Another option, if you're thinking of writing some code to do this, would be to write a small Java/Groovy/Jython/JRuby program to parse the files and create SQLObjects directly, then save them into a .architect file using our API. If you know any of those languages, it would probably be the easier approach (versus creating a .architect file directly).

-Jonathan
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

Sounds like I need to get myself familiarized with your API. I am going to write the code in Java so using the API to put them into an architect file is definitely sounding like my best option.
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

Here are our instructions about how to check out and build the project: http://code.google.com/p/power-architect/wiki/GettingStarted

Once you've got it running from Eclipse (or your other IDE of choice), I'd suggest you create a new project that depends on the power-architect project and put all your code in there.

Also, once you're there, come back and ask us for some tips. We can cook up a little example program with a main() method that creates some tables, columns, and relations then saves them in a project file. Should save you a lot of time, because once you have that, the API you'll need to deal with is pretty intuitive (IMHO!)

-Jonathan
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

Thanks! I downloaded the code through Eclipse/SVN.. I see a lot of errors in the sqlpower_library project but I am able to run the architect project (ArchitectFrame) from inside eclipse if I ignore the errors. Should I worry about them or just ignore?
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

You have to build the library against JDK 1.5. This is because our JDBC Wrappers only implement the JDBC 3 interfaces. It should compile without any errors against 1.5.

-Jonathan
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

Thanks, I missed that. I had JDK 1.6 on
castorp


Joined: 2008-03-06 13:38:06
Messages: 129
Offline

Jonathan wrote:If you paste a multi-line string into the playpen, the Architect will create one table per line of text. Then if you paste a multi-line string into a table, the Architect will create one column in that table per line of text. This is probably the easiest way to achieve what you want to do.
How do I do that?
The paste item is always disabled for me.
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

Jonathan wrote:Also, once you're there, come back and ask us for some tips. We can cook up a little example program with a main() method that creates some tables, columns, and relations then saves them in a project file. Should save you a lot of time, because once you have that, the API you'll need to deal with is pretty intuitive (IMHO!)
-Jonathan


I got everything set up and browsed through the API doc and some of the code. I assume I will need to use the factory classes to create the tables etc. I would definitely like to see some sample code, anything that'll save me time is welcome
JAyliffe


Joined: 2009-06-23 11:17:10
Messages: 13
Offline

I am working my way down through the creation of a schema, one question that I have is if I create new SQLObject(parent, <some other parameters>) so the child knows its parent, should I also be calling a setSomeChildObject(childObject) method on the parent so it knows its children too?

UPDATE: answered my own question here, you have to add the children to the parent since at some point you are going to have to ask the parent for a list of children...

This message was edited 1 time. Last update was at 2009-07-01 16:44:40

Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

castorp wrote:
Jonathan wrote:If you paste a multi-line string into the playpen, the Architect will create one table per line of text. Then if you paste a multi-line string into a table, the Architect will create one column in that table per line of text. This is probably the easiest way to achieve what you want to do.
How do I do that?
The paste item is always disabled for me.

I assume you're using the latest Architect code from svn , but which OS and JRE version are you using? In all our testing, the new copy&paste features have "just worked."

-Jonathan
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 873
Offline

JAyliffe wrote:I am working my way down through the creation of a schema, one question that I have is if I create new SQLObject(parent, <some other parameters>) so the child knows its parent, should I also be calling a setSomeChildObject(childObject) method on the parent so it knows its children too?

UPDATE: answered my own question here, you have to add the children to the parent since at some point you are going to have to ask the parent for a list of children...

Yes, that's right. In fact, we will be removing the parent argument from all the SQLObject constructors before the API hits 1.0. Asking for the parent up front was a mistake we made early in the Architect API's history.

It might be a bit late for you, but I've created the promised example program. Find it here:

http://code.google.com/p/power-architect/source/browse/trunk/example_code/ca/sqlpower/architect/example/ProjectCreator.java

-Jonathan
 
Forum Index » SQL Power Architect Discussion
Go to:   
Powered by JForum 2.1.8 © JForum Team