/[cvs]/nfo/perl/libs/Data/Storage.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage.pm

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

revision 1.8 by joko, Fri Nov 29 04:48:23 2002 UTC revision 1.10 by joko, Sat Dec 7 03:37:23 2002 UTC
# Line 7  Line 7 
7  ############################################  ############################################
8  #  #
9  #  $Log$  #  $Log$
10    #  Revision 1.10  2002/12/07 03:37:23  joko
11    #  + updated pod
12    #
13    #  Revision 1.9  2002/12/01 22:15:45  joko
14    #  - sub createDb: moved to handler
15    #
16  #  Revision 1.8  2002/11/29 04:48:23  joko  #  Revision 1.8  2002/11/29 04:48:23  joko
17  #  + updated pod  #  + updated pod
18  #  #
# Line 362  sub testDsn { Line 368  sub testDsn {
368    if ( my $dbh = DBI->connect($dsn, '', '', {    if ( my $dbh = DBI->connect($dsn, '', '', {
369                                                        PrintError => 0,                                                        PrintError => 0,
370                                                        } ) ) {                                                        } ) ) {
371        
372        # TODO: REVIEW
373      $dbh->disconnect();      $dbh->disconnect();
374        
375      return 1;      return 1;
376    } else {    } else {
377      $logger->warning( __PACKAGE__ .  "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr );      $logger->warning( __PACKAGE__ .  "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr );
# Line 376  sub testAvailability { Line 385  sub testAvailability {
385    return $status;    return $status;
386  }  }
387    
 sub createDb {  
   my $self = shift;  
   my $dsn = $self->{locator}->{dbi}->{dsn};  
   
   $logger->debug( __PACKAGE__ .  "->createDb( dsn $dsn )" );  
   
   $dsn =~ s/database=(.+?);//;  
   my $database_name = $1;  
   
   my $ok;  
     
   if ( my $dbh = DBI->connect($dsn, '', '', {  
                                                       PrintError => 0,  
                                                       } ) ) {  
     if ($database_name) {  
       if ($dbh->do("CREATE DATABASE $database_name;")) {  
         $ok = 1;  
       }  
     }  
     $dbh->disconnect();  
   }  
     
   return $ok;  
     
 }  
388    
389  sub dropDb {  sub dropDb {
390    my $self = shift;    my $self = shift;
# Line 421  sub dropDb { Line 405  sub dropDb {
405          $ok = 1;          $ok = 1;
406        }        }
407      }      }
408    
409      $dbh->disconnect();      $dbh->disconnect();
410    
411    }    }
412        
413    return $ok;    return $ok;
# Line 531  Compare schema (structure diff) with dat Line 517  Compare schema (structure diff) with dat
517      -  .pst - files (Outlook Post Storage?)      -  .pst - files (Outlook Post Storage?)
518      -  XML (e.g. via XML::Simple?)      -  XML (e.g. via XML::Simple?)
519    - Move to t3, look at InCASE    - Move to t3, look at InCASE
520      - some kind of security layer for methods/objects
521        - acls (stored via tangram/ldap?) for functions, methods and objects (entity- & data!?)
522        - where are the hooks needed then?
523          - is Data::Storage & Co. okay, or do we have to touch the innards of DBI and/or Tangram?
524          - an attempt to start could be:
525             - 'sub getACLByObjectId($id, $context)'
526             - 'sub getACLByMethodname($id, $context)'
527             - 'sub getACLByName($id, $context)'
528                ( would require a kinda registry to look up these very names pointing to arbitrary locations (code, data, ...) )
529    
530    
531    
532  =head3 LINKS / REFERENCES  =head3 LINKS / REFERENCES

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed