[Bio] / Sprout / ERDB.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Fri Feb 25 18:41:45 2005 UTC revision 1.5, Tue Apr 5 05:17:01 2005 UTC
# Line 67  Line 67 
67  was inserted by the L</InsertObject> method.  was inserted by the L</InsertObject> method.
68    
69  To facilitate testing, the ERDB module supports automatic generation of test data. This process  To facilitate testing, the ERDB module supports automatic generation of test data. This process
70  is described in the L</GenerateEntity> and L</GenerateConnection> methods.  is described in the L</GenerateEntity> and L</GenerateConnection> methods, though it is not yet
71    fully implemented.
72    
73  =cut  =cut
74    
# Line 111  Line 112 
112    
113  =head3 new  =head3 new
114    
115  C<< my $database = ERDB::new($dbh, $metaFileName); >>  C<< my $database = ERDB->new($dbh, $metaFileName); >>
116    
117  Create a new ERDB object.  Create a new ERDB object.
118    
# Line 136  Line 137 
137          my $metaData = _LoadMetaData($metaFileName);          my $metaData = _LoadMetaData($metaFileName);
138          # Create the object.          # Create the object.
139          my $self = { _dbh => $dbh,          my $self = { _dbh => $dbh,
140                                   _metaData => $metaData,                                   _metaData => $metaData
                                  _options => $options,  
141                             };                             };
142          # Bless and return it.          # Bless and return it.
143          bless $self;          bless $self;
# Line 173  Line 173 
173          my $relationshipList = $metadata->{Relationships};          my $relationshipList = $metadata->{Relationships};
174          # Open the output file.          # Open the output file.
175          open(HTMLOUT, ">$filename") || Confess("Could not open MetaData display file $filename: $!");          open(HTMLOUT, ">$filename") || Confess("Could not open MetaData display file $filename: $!");
176            Trace("Building MetaData table of contents.") if T(4);
177          # Write the HTML heading stuff.          # Write the HTML heading stuff.
178          print HTMLOUT "<html>\n<head>\n<title>$title</title>\n";          print HTMLOUT "<html>\n<head>\n<title>$title</title>\n";
179          print HTMLOUT "</head>\n<body>\n";          print HTMLOUT "</head>\n<body>\n";
# Line 200  Line 201 
201          print HTMLOUT "<a name=\"EntitiesSection\"></a><h2>Entities</h2>\n";          print HTMLOUT "<a name=\"EntitiesSection\"></a><h2>Entities</h2>\n";
202          # Loop through the entities.          # Loop through the entities.
203          for my $key (sort keys %{$entityList}) {          for my $key (sort keys %{$entityList}) {
204                    Trace("Building MetaData entry for $key entity.") if T(4);
205                  # Create the entity header. It contains a bookmark and the entity name.                  # Create the entity header. It contains a bookmark and the entity name.
206                  print HTMLOUT "<a name=\"$key\"></a><h3>$key</h3>\n";                  print HTMLOUT "<a name=\"$key\"></a><h3>$key</h3>\n";
207                  # Get the entity data.                  # Get the entity data.
# Line 238  Line 240 
240          print HTMLOUT "<a name=\"RelationshipsSection\"></a><h2>Relationships</h2>\n";          print HTMLOUT "<a name=\"RelationshipsSection\"></a><h2>Relationships</h2>\n";
241          # Loop through the relationships.          # Loop through the relationships.
242          for my $key (sort keys %{$relationshipList}) {          for my $key (sort keys %{$relationshipList}) {
243                    Trace("Building MetaData entry for $key relationship.") if T(4);
244                  # Get the relationship's structure.                  # Get the relationship's structure.
245                  my $relationshipStructure = $relationshipList->{$key};                  my $relationshipStructure = $relationshipList->{$key};
246                  # Create the relationship header.                  # Create the relationship header.
# Line 268  Line 271 
271                  my $htmlString = _ShowRelationTable($key, $relationshipStructure->{Relations}->{$key});                  my $htmlString = _ShowRelationTable($key, $relationshipStructure->{Relations}->{$key});
272                  print HTMLOUT $htmlString;                  print HTMLOUT $htmlString;
273          }          }
274            Trace("Building MetaData join table.") if T(4);
275          # Denote we're starting the join table.          # Denote we're starting the join table.
276          print HTMLOUT "<a name=\"JoinTable\"></a><h3>Join Table</h3>\n";          print HTMLOUT "<a name=\"JoinTable\"></a><h3>Join Table</h3>\n";
277          # Create a table header.          # Create a table header.
# Line 289  Line 293 
293          print HTMLOUT "</body>\n</html>\n";          print HTMLOUT "</body>\n</html>\n";
294          # Close the file.          # Close the file.
295          close HTMLOUT;          close HTMLOUT;
296            Trace("Built MetaData web page.") if T(3);
297  }  }
298    
299  =head3 DumpMetaData  =head3 DumpMetaData
# Line 2260  Line 2265 
2265                  my $indexData = $indexTable->{$indexName};                  my $indexData = $indexTable->{$indexName};
2266                  # Determine whether or not the index is unique.                  # Determine whether or not the index is unique.
2267                  my $fullName = $indexName;                  my $fullName = $indexName;
2268                  if ($indexData->{Unique} eq "true") {                  if (exists $indexData->{Unique} && $indexData->{Unique} eq "true") {
2269                          $fullName .= " (unique)";                          $fullName .= " (unique)";
2270                  }                  }
2271                  # Start an HTML list item for this index.                  # Start an HTML list item for this index.

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3