take out duplicate docs
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / DiaUml.pm
CommitLineData
35a1938f 1package SQL::Translator::Producer::DiaUml;
2
44659089 3# -------------------------------------------------------------------
4# Copyright (C) 2002-2009 SQLFairy Authors
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License as
8# published by the Free Software Foundation; version 2.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18# 02111-1307 USA
19# -------------------------------------------------------------------
20
35a1938f 21=pod
22
23=head1 NAME
24
25SQL::Translator::Producer::DiaUml -
26 Produces dia UML diagrams from schema.
27
28=head1 SYNOPSIS
29
30 use SQL::Translator;
31 my $translator = SQL::Translator->new(
32 from => 'MySQL',
33 filename => 'foo_schema.sql',
34 to => 'DiaUml',
35 );
36 print $translator->translate;
37
38=head1 DESCRIPTION
39
40Currently you will get one class (with the a table
41stereotype) generated per table in the schema. The fields are added as
42attributes of the classes and their datatypes set. It doesn't currently set any
43of the relationships. It doesn't do any layout, all the classses are in one big
44stack. However it is still useful as you can use the layout tools in Dia to
45automatically arrange them horizontally or vertically.
46
47=head2 Producer Args
48
49=over 4
50
51=back
52
53=cut
54
35a1938f 55use strict;
56
da06ac74 57use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
11ad2df9 58$VERSION = '1.59';
35a1938f 59$DEBUG = 0 unless defined $DEBUG;
60
6e64adbe 61use File::ShareDir qw/dist_dir/;
62
35a1938f 63use SQL::Translator::Utils 'debug';
35a1938f 64use base qw/SQL::Translator::Producer::TT::Base/;
65# Convert produce call into a method call on our class
66sub produce { return __PACKAGE__->new( translator => shift )->run; };
67
35a1938f 68sub tt_config {
6e64adbe 69 ( INCLUDE_PATH => File::Spec->catdir (dist_dir('SQL-Translator'), 'DiaUml') );
35a1938f 70}
71
72sub tt_schema { 'schema.tt2' }
73
741;
75
35a1938f 76=pod
77
78=head1 AUTHOR
79
80Mark Addison E<lt>grommit@users.sourceforge.netE<gt>.
81
82=head1 TODO
83
84* Add the foriegn keys from the schema as UML relations.
85
86* Layout the classes.
87
88=head1 SEE ALSO
89
90SQL::Translator.
91
92=cut