| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# HTMLView.pm - For handling DBI relation databases and web interfaces. |
|
4
|
|
|
|
|
|
|
# (c) Copyright 1999 Hakan Ardo |
|
5
|
|
|
|
|
|
|
# |
|
6
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify |
|
7
|
|
|
|
|
|
|
# it under the terms of the GNU General Public License as published by |
|
8
|
|
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or |
|
9
|
|
|
|
|
|
|
# any later version. |
|
10
|
|
|
|
|
|
|
# |
|
11
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, |
|
12
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14
|
|
|
|
|
|
|
# GNU General Public License for more details. |
|
15
|
|
|
|
|
|
|
# |
|
16
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
|
17
|
|
|
|
|
|
|
# along with this program; if not, write to the Free Software |
|
18
|
|
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
DBIx::HTMLView - For handling DBI relation databases and web interfaces |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use DBIx::HTMLView; |
|
27
|
|
|
|
|
|
|
my $dbi=DB("DBI:mSQL:HTMLViewTester:localhost", "", "", |
|
28
|
|
|
|
|
|
|
Table ('Test', Id('id'), Str('testf')), |
|
29
|
|
|
|
|
|
|
Table('Test2', Id('id'), Str('str'), Int('nr')) |
|
30
|
|
|
|
|
|
|
); |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
HTMLView is a set of modules to handle relational SQL databases |
|
36
|
|
|
|
|
|
|
through a DBI interface and create web user interfaces to them. Among |
|
37
|
|
|
|
|
|
|
its features are the posibility to handle relations in the same |
|
38
|
|
|
|
|
|
|
manner as fields and it is easily extended with additional field or |
|
39
|
|
|
|
|
|
|
relation specifications as well as custom editors and viewers. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
For a general overview description of the system see the README file, |
|
42
|
|
|
|
|
|
|
for a quick start see the test.pl script. It conatins instructions on |
|
43
|
|
|
|
|
|
|
how to set up a simple test database and then it preforms all the |
|
44
|
|
|
|
|
|
|
basic opperations in a comented manner. There is also a tutorial |
|
45
|
|
|
|
|
|
|
(not yet written) describing the basics of relation databases and |
|
46
|
|
|
|
|
|
|
how to build web interfaces to them using HTMLView. Finaly there is |
|
47
|
|
|
|
|
|
|
a man page for every package describing it's methods and |
|
48
|
|
|
|
|
|
|
functionality. |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This package contains shourtcuts for the constructors of some of the |
|
51
|
|
|
|
|
|
|
basic objects under DBIx::HTMLView that are used to created the |
|
52
|
|
|
|
|
|
|
database description structure. This structure describes all the |
|
53
|
|
|
|
|
|
|
tables in the database and its fields, and is then used as an |
|
54
|
|
|
|
|
|
|
interface to the database and the tables. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
For a description of parameters to the separate functions see the |
|
57
|
|
|
|
|
|
|
diffrent packages man pages, eg DB is actualy the new method of |
|
58
|
|
|
|
|
|
|
DBIx::HTMLView::DB. Curently we have shourtcuts for the following |
|
59
|
|
|
|
|
|
|
objects: |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
msqlDB |
|
62
|
|
|
|
|
|
|
mysqlDB |
|
63
|
|
|
|
|
|
|
OracleDB |
|
64
|
|
|
|
|
|
|
Table |
|
65
|
|
|
|
|
|
|
Int |
|
66
|
|
|
|
|
|
|
Date |
|
67
|
|
|
|
|
|
|
Str |
|
68
|
|
|
|
|
|
|
Bool |
|
69
|
|
|
|
|
|
|
Text |
|
70
|
|
|
|
|
|
|
Id |
|
71
|
|
|
|
|
|
|
N2N |
|
72
|
|
|
|
|
|
|
N2One |
|
73
|
|
|
|
|
|
|
Tree |
|
74
|
|
|
|
|
|
|
SubTab |
|
75
|
|
|
|
|
|
|
Order |
|
76
|
|
|
|
|
|
|
N2NOrder |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
For backwards compatibility there is also a DB method calling msqlDB. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 METHODS |
|
81
|
|
|
|
|
|
|
=cut |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
package DBIx::HTMLView; |
|
85
|
1
|
|
|
1
|
|
674
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
130
|
|
|
86
|
1
|
|
|
1
|
|
5
|
use vars qw(@ISA $VERSION @EXPORT); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
630
|
|
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
$VERSION="0.9"; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
require Exporter; |
|
91
|
|
|
|
|
|
|
require DBIx::HTMLView::DB; |
|
92
|
|
|
|
|
|
|
require DBIx::HTMLView::mysqlDB; |
|
93
|
|
|
|
|
|
|
require DBIx::HTMLView::msqlDB; |
|
94
|
|
|
|
|
|
|
require DBIx::HTMLView::OracleDB; |
|
95
|
|
|
|
|
|
|
require DBIx::HTMLView::Table; |
|
96
|
|
|
|
|
|
|
require DBIx::HTMLView::Int; |
|
97
|
|
|
|
|
|
|
require DBIx::HTMLView::Str; |
|
98
|
|
|
|
|
|
|
require DBIx::HTMLView::Date; |
|
99
|
|
|
|
|
|
|
require DBIx::HTMLView::Bool; |
|
100
|
|
|
|
|
|
|
require DBIx::HTMLView::Text; |
|
101
|
|
|
|
|
|
|
require DBIx::HTMLView::Id; |
|
102
|
|
|
|
|
|
|
require DBIx::HTMLView::N2N; |
|
103
|
|
|
|
|
|
|
require DBIx::HTMLView::N2One; |
|
104
|
|
|
|
|
|
|
require DBIx::HTMLView::Tree; |
|
105
|
|
|
|
|
|
|
require DBIx::HTMLView::SubTab; |
|
106
|
|
|
|
|
|
|
require DBIx::HTMLView::Order; |
|
107
|
|
|
|
|
|
|
require DBIx::HTMLView::N2NOrder; |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
|
110
|
|
|
|
|
|
|
@EXPORT = qw(DB OracleDB mysqlDB msqlDB Table Str Bool Text Id N2N Int N2One Date Tree SubTab Order N2NOrder); |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub DB { |
|
113
|
0
|
|
|
0
|
|
|
msqlDB(@_) # For backwards compatibility |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub mysqlDB { |
|
117
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::mysqlDB->new(@_); |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub msqlDB { |
|
121
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::msqlDB->new(@_); |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub OracleDB { |
|
125
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::OracleDB->new(@_); |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub Table { |
|
129
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Table->new(@_); |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub Int { |
|
133
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Int->new(@_); |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub Str { |
|
137
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Str->new(@_); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub Date { |
|
141
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Date->new(@_); |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub Bool { |
|
145
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Bool->new(@_); |
|
146
|
|
|
|
|
|
|
} |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub Text { |
|
149
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Text->new(@_); |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub Id { |
|
153
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Id->new(@_); |
|
154
|
|
|
|
|
|
|
} |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
sub N2N { |
|
157
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::N2N->new(@_); |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub N2One { |
|
161
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::N2One->new(@_); |
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub Tree { |
|
165
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Tree->new(@_); |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub SubTab { |
|
169
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::SubTab->new(@_); |
|
170
|
|
|
|
|
|
|
} |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub Order { |
|
173
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::Order->new(@_); |
|
174
|
|
|
|
|
|
|
} |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub N2NOrder { |
|
177
|
0
|
|
|
0
|
|
|
DBIx::HTMLView::N2NOrder->new(@_); |
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
# Local Variables: |
|
183
|
|
|
|
|
|
|
# mode: perl |
|
184
|
|
|
|
|
|
|
# tab-width: 8 |
|
185
|
|
|
|
|
|
|
# perl-indent-level: 2 |
|
186
|
|
|
|
|
|
|
# End: |