]> Frank Brehm's Git Trees - books.git/commitdiff
Grundstruktur an neue Catalyst-Version angepasst
authorFrank Brehm <frank@brehm-online.com>
Mon, 15 Feb 2010 10:46:43 +0000 (10:46 +0000)
committerFrank Brehm <frank@brehm-online.com>
Mon, 15 Feb 2010 10:46:43 +0000 (10:46 +0000)
43 files changed:
frbr_books.yml
lib/FrBr/Books.pm
lib/FrBr/Books/Controller/Root.pm
lib/FrBr/Books/Db.pm
lib/FrBr/Books/Db/Autor2buch.pm [deleted file]
lib/FrBr/Books/Db/Autoren.pm [deleted file]
lib/FrBr/Books/Db/Bindungsarten.pm [deleted file]
lib/FrBr/Books/Db/Buch2kategorie.pm [deleted file]
lib/FrBr/Books/Db/Buch2serie.pm [deleted file]
lib/FrBr/Books/Db/BuchListe.pm [deleted file]
lib/FrBr/Books/Db/Buecher.pm [deleted file]
lib/FrBr/Books/Db/Kategorien.pm [deleted file]
lib/FrBr/Books/Db/Orte.pm [deleted file]
lib/FrBr/Books/Db/Result/Autor2buch.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Autoren.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Bindungsarten.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Buch2kategorie.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Buch2serie.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/BuchListe.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Buecher.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Kategorien.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Orte.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Serien.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Session.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/UserAdd.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Users.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Verlage.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Result/Waehrungen.pm [new file with mode: 0644]
lib/FrBr/Books/Db/Serien.pm [deleted file]
lib/FrBr/Books/Db/Session.pm [deleted file]
lib/FrBr/Books/Db/UserAdd.pm [deleted file]
lib/FrBr/Books/Db/Users.pm [deleted file]
lib/FrBr/Books/Db/Verlage.pm [deleted file]
lib/FrBr/Books/Db/Waehrungen.pm [deleted file]
lib/FrBr/Books/Plugin/ConfigLoader.pm
log4perl.conf [new file with mode: 0644]
repo-browser/svnindex.css [new file with mode: 0644]
repo-browser/svnindex.xsl [new file with mode: 0644]
script/frbr_books_cgi.pl
script/frbr_books_create.pl
script/frbr_books_fastcgi.pl
script/frbr_books_server.pl
script/frbr_books_test.pl

index cfe7c01f73bd468aaa1a7d1330d716238c0cf88e..892a803ab37290437ac7f74ecb3d2b665c0e668e 100644 (file)
@@ -16,6 +16,8 @@ default_list_length:    20
 #
 # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
 default_count_books_in_other_list: 5
+# Vorgabe-View (kann mit $c->stash->{'current_view_instance'} oder $c->stash->{'current_view'} ueberschrieben werden).
+#default_view: TtDefault
 #
 # Sitzungsparameter
 session:
@@ -23,14 +25,10 @@ session:
 #
 # Direkte Modell-Konfiguration:
 'Model::Schema':
-   schema_class: 'FrBr::Books::Db'
    connect_info:
-      - 'DBI:mysql:database=books;host=localhost'
-      - 'books'
-      - ~
-      - AutoCommit: 1
-        PrintError: 0
-        RaiseError: 0
+      dsn: 'DBI:mysql:database=books;host=localhost'
+      user: 'books'
+      password: ~
 #
 authentication:
    dbic:
index 454cac8412b44c4ad79db273cdc6136952adae52..ceb5bacf3e04d4368220cabdb35c87a4aedd41a1 100644 (file)
@@ -8,7 +8,6 @@ use warnings;
 
 use Catalyst::Runtime '5.70';
 
-use Sys::Hostname;
 use Catalyst::Log::Log4perl;
 use FrBr::Common;
 
@@ -20,6 +19,8 @@ use FrBr::Common;
 # Static::Simple: will serve static files from the application's root 
 #                 directory
 
+use parent qw/Catalyst/;
+
 use Catalyst qw/
 
     +FrBr::Books::Plugin::ConfigLoader
@@ -39,17 +40,7 @@ use Catalyst qw/
 
 /;
 
-our $VERSION = '0.02';
-
-my %LangsToUse = (
-    'de' => 'deutsch',
-    'en' => 'english',
-);
-
-my %LangsToUseInDates = (
-    'de' => 'Deutsch',
-    'en' => 'English',
-);
+our $VERSION = '0.03';
 
 # Configure the application. 
 #
@@ -89,163 +80,78 @@ __PACKAGE__->config(
             'book_data_edit',
         ],
     },
+    'Model::Schema' => {
+        'schema_class' => 'CoNet::SwAdmin::Schema',
+        'connect_info' => {
+            'AutoCommit' => 1,
+            'PrintError' => 0,
+            'RaiseError' => 0,
+            'quote_char' => '`',
+            'name_sep'   => '.',
+            'on_connect_do' => [
+                "SET NAMES 'utf8'",
+            ],
+        },
+    },
+    'default_view'  => 'TtDefault',
+    'View::TtDefault' => {
+        'CATALYST_VAR' => 'Catalyst',
+        'INCLUDE_PATH' => [
+            __PACKAGE__->path_to( 'root', 'src' ),
+            __PACKAGE__->path_to( 'root', 'lib' ),
+        ],
+        'PRE_PROCESS'        => 'config/main.tt2',
+        'WRAPPER'            => 'site/wrapper.tt2',
+        'ERROR'              => 'error.tt2',
+        'TIMER'              => 0,
+        'PRE_CHOMP'          => 0,
+        'POST_CHOMP'         => 0,
+        'TEMPLATE_EXTENSION' => '.tt2',
+    },
 );
 
-# Start the application
-__PACKAGE__->setup;
-
-#-------------------------------------------------------
-
-sub auto : Private {
-
-    my ( $self, $c ) = @_;
-    my $K = ( caller(0) )[3] . "(): ";
-
-    my $self_url = $c->request->base . $c->request->path;
-    $self_url =~ s#^https?://[^/]+/#/#;
-    $c->stash->{'self_url'} = $self_url;
-
-    my $storage = $c->model('Schema')->storage;
-    $c->stash->{'storage'} = $storage;
-
-    $c->stash->{'site_title'} = "Franks Büchersammlung";
-
-    $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
-    push @{ $c->stash->{'menu_path'} }, {
-        'path' => $c->web_path("/"),
-        'name' => "Startseite"
-    };
-
-    $c->config->{'debug_level'} = 0 unless defined $c->config->{'debug_level'};
-    $c->log->debug( get_output_string( $K, "Aktuelle Konfiguration: ", $c->config ) ) if $c->config->{'debug_level'} >= 3;
-
-    $c->stash->{'debug_level'} = to_int( $c->config->{'debug_level'} ) || 0;
-    my $env_debug_level = to_int( $ENV{'FRBR_BOOKS_DEBUG'} || $ENV{'CATALYST_DEBUG'} );
-    $c->stash->{'debug_level'} = $env_debug_level if $env_debug_level and $env_debug_level > $c->stash->{'debug_level'};
-    $c->log->debug( $K . "Aktuelles Debug-Level: " . $c->stash->{'debug_level'} ) if $c->stash->{'debug_level'};
-
-    $c->log->debug( get_output_string( $K . "Speicher-Objekt: ", $storage ) ) if $c->stash->{'debug_level'} >= 6;
-
-    # Feststellen, ob es eine Testumgebung ist
-    $c->stash->{'is_test_environment'} = 0;
-    if ( $c->config->{'is_test_environment'} ) {
-        $c->log->debug( $K . "TEST-Umgebung" ) if $c->stash->{'debug_level'};
-        $c->stash->{'is_test_environment'} = 1;
-    }
-
-    $storage->sql_maker->quote_char( [qw/` `/] );
-    $storage->sql_maker->name_sep('.');
-
-    my $SQL = "SET NAMES 'utf8'";
-    warn $SQL . ";\n" if $storage->debug();
-
-    $storage->dbh_do(
-        sub {
-            my ( $storage_a, $dbh ) = @_;
-            $dbh->do($SQL);
-        }
-    );
-
-    $c->session->{'last_run'} = localtime();
+warn sprintf( "%s: Beginne mit Log::Log4perl-Konfiguration!\n",  __PACKAGE__ ) if $ENV{'CATALYST_DEBUG'} or $ENV{'FRBR_BOOKS_DEBUG'};
+my $log4perl_config = <<ENDE;
+log4perl.rootLogger=INFO, A1
+log4perl.appender.A1=Log::Log4perl::Appender::Screen
+log4perl.appender.A1.stderr=1
+log4perl.appender.A1.utf8=1
+log4perl.appender.A1.layout=PatternLayout
+log4perl.appender.A1.layout.ConversionPattern=[%d] [SwAdmin] [%p] %m%n
+ENDE
 
-    # Letzten und aktuellen Pfad behalten
-    my $last_path = $c->session->{'last_path'} || '';
-    my $cur_path  = $c->session->{'cur_path'}  || '';
-    my $req_path  = '/' . $c->request->path();
-    if ( $req_path ne $cur_path ) {
-        $c->session->{'last_path'} = $cur_path;
-        $c->session->{'cur_path'}  = $req_path;
-    }
+my $log4perl_params = { 'override_cspecs' => 1, };
 
-    # Request-URI in Sitzung einpflegen
-    $c->session->{'request'}           = {};
-    $c->session->{'request'}{'uri'}    = $c->req->uri();
-    $c->session->{'request'}{'host'}   = hostname();
-    $c->session->{'request'}{'client'} = $c->req->address();
-    $c->session->{'request'}{'uagent'} = $c->req->user_agent();
+if ( -f __PACKAGE__->path_to( 'log4perl_local.conf' ) ) {
+    $log4perl_config = sprintf( "%s", __PACKAGE__->path_to( 'log4perl_local.conf' ) );
+    $log4perl_params->{'watch_delay'} = 10;
+    warn sprintf( "%s: Verwendete Log::Log4perl-Konfigurationsdatei: '%s'\n",  __PACKAGE__, $log4perl_config ) if $ENV{'CATALYST_DEBUG'} or $ENV{'FRBR_BOOKS_DEBUG'};
 
-    ########################
-    # Sprachabhaengige Dinge
+    __PACKAGE__->log( Catalyst::Log::Log4perl->new( $log4perl_config, $log4perl_params ) );
 
-    my $lang = 'de';
+}
+elsif ( -f __PACKAGE__->path_to( 'log4perl.conf' ) ) {
+    #$log4perl_config = __PACKAGE__->path_to( 'log4perl.conf' );
+    $log4perl_config = sprintf( "%s", __PACKAGE__->path_to( 'log4perl.conf' ) );
+    $log4perl_params->{'watch_delay'} = 10;
+    warn sprintf( "%s: Verwendete Log::Log4perl-Konfigurationsdatei: '%s'\n",  __PACKAGE__, $log4perl_config ) if $ENV{'CATALYST_DEBUG'} or $ENV{'FRBR_BOOKS_DEBUG'};
 
-    # Neue Sprache festlegen:
-    if ( $c->req->param('new_lang_to_use') and $LangsToUse{ $c->req->param('new_lang_to_use') } ) {
-        $lang = $c->req->param('new_lang_to_use');
-        #$c->session->{'lang_to_use'} = $lang;
-    }
-    else {
-        #$lang = $c->session->{'lang_to_use'} if $c->session->{'lang_to_use'};
-    }
-    #$c->languages( [$lang] );
-    #$c->stash->{'lang_to_use'} = $lang;
-    #$c->log->debug( $K . "Neue Sprache: '" . $lang . "' (" . $LangsToUseInDates{$lang} . ")." ) if $c->stash->{'debug_level'} >= 2;
+    __PACKAGE__->log( Catalyst::Log::Log4perl->new( $log4perl_config, $log4perl_params ) );
 
-    # Login-abhaengige Dinge
+}
+else {
+    warn sprintf( "%s: Verwendete Log::Log4perl-Konfiguration:\n%s\n",  __PACKAGE__, $log4perl_config ) if $ENV{'CATALYST_DEBUG'} or $ENV{'FRBR_BOOKS_DEBUG'};
 
-    $c->stash->{'login_action'} = 'login';
+    __PACKAGE__->log( Catalyst::Log::Log4perl->new( \$log4perl_config, $log4perl_params ) );
 
-    if ( ( $c->controller eq $c->controller('Login') ) or ( $c->controller eq $c->controller('Logout') ) ) {
-        $c->stash->{'login_action'} = 'none';
-    }
-    elsif ( $c->user_exists ) {
+}
 
-        my $user_info = $c->user();
-        #$c->log->debug( get_output_string( $K, "Aktueller Nutzer: ", $user_info ) ) if $c->config->{'debug_level'} >= 4;
-        my $uid       = $user_info->user_id;
-        my $user_name = $user_info->login;
-        if ( $user_info->nachname ) {
-            $user_name = $user_info->nachname;
-            $user_name = $user_info->vorname . " " . $user_name if $user_info->vorname;
-        }
-        $c->stash->{'current_user'}                     = $user_name;
-        $c->stash->{'current_user_id'}                  = $user_info->user_id;
-        $c->stash->{'login_action'}                     = 'logout';
-        $c->stash->{'current_user_is_manager'}          = 0;
-        $c->stash->{'current_user_is_human_resources'} = 0;
-        $c->stash->{'current_user_deps'}                = {};
-        $c->session->{'current_user_name'}              = $user_name;
-        $c->session->{'last_login_name'}                = $user_info->login();
-
-        #set_last_activity_time($c);
-
-        if ( $c->stash->{'debug_level'} >= 2 ) {
-            $c->log->debug( $K
-                    . "Aktuelle Nutzerinformationen:\n"
-                    . "  Name:          '" . $c->stash->{'current_user'} . "'\n"
-                    . "  Nutzer-Id:      " . $c->stash->{'current_user_id'} . "\n"
-                    . "  Ist Manager:    " . ( $c->stash->{'current_user_is_manager'} ? 'Ja' : 'Nein' ) . "\n"
-                    . "  Ist Personaler: " . ( $c->stash->{'current_user_is_human_resources'} ? 'Ja' : 'Nein' ) . "\n"
-                    . "  Abteilungen:    " . get_output_string( $c->stash->{'current_user_deps'} ) );
-        } ## end if ( $c->stash->{'debug_level'} >= 2 )
-
-    } ## end elsif ( $c->user_exists )
-
-    $c->stash->{'last_login_name'} = $c->session->{'last_login_name'};
-
-    $c->log->debug( $K . "Aktuelle Script-URL: '" . $c->stash->{'self_url'} . "'." ) if $c->stash->{'debug_level'} >= 2;
-    $c->log->debug( get_output_string( $K, "Aktueller Request: ", $c->req ) )  if $c->config->{'debug_level'} >= 3;
-
-    # Listenlaenge festlegen
-    $c->stash->{'list_length'} = $c->session->{'list_length'} || $c->config->{'default_list_length'} || 20;
-
-    # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
-    $c->stash->{'books_in_other_list'} = $c->session->{'books_in_other_list'} || $c->config->{'default_count_books_in_other_list'} || 10;
-
-    1;
-
-} ## end sub auto :
-
-#-------------------------------------------------------
-
-sub not_allowed : Local {
-
-    my ( $self, $c ) = @_;
-    my $K = ( caller(0) )[3] . "(): ";
-
-    $c->stash->{'template'} = 'not_allowed.tt2';
+# Start the application
+__PACKAGE__->log->info( sprintf( "%s: Starte Setup.",  __PACKAGE__ ) );
+__PACKAGE__->setup;
+__PACKAGE__->log->info( sprintf( "%s: Ich bin gestartet!",  __PACKAGE__ ) );
 
-}
+#---------------------------------------------------------------------------
 
 =head1 NAME
 
index b1e1b2f3533df0bafefeecd402a5759d4f9bd349..5ebe27b65aaa68c4abe2e469bacb4255ec6891d6 100644 (file)
@@ -6,8 +6,11 @@ package FrBr::Books::Controller::Root;
 use strict;
 use warnings;
 use base 'Catalyst::Controller';
+use Sys::Hostname;
 use FrBr::Common;
 
+our $VERSION = '0.02';
+
 #
 # Sets the actions in this controller to be registered with no prefix
 # so they function identically to actions created in MyApp.pm
@@ -22,12 +25,22 @@ FrBr::Books::Controller::Root - Root Controller for FrBr::Books
 
 [enter your description here]
 
-=head1 METHODS
-
 =cut
 
+my %LangsToUse = (
+    'de' => 'deutsch',
+    'en' => 'english',
+);
+
+my %LangsToUseInDates = (
+    'de' => 'Deutsch',
+    'en' => 'English',
+);
+
 #---------------------------------------------------------------------------
 
+=head1 METHODS
+
 =head2 default
 
 =cut
@@ -75,6 +88,165 @@ sub end : ActionClass('RenderView') {
 
 }
 
+#-------------------------------------------------------
+
+sub auto : Private {
+
+    my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    my $self_url = $c->request->base . $c->request->path;
+    $self_url =~ s#^https?://[^/]+/#/#;
+    $c->stash->{'self_url'} = $self_url;
+
+    my $storage = $c->model('Schema')->storage;
+    $c->stash->{'storage'} = $storage;
+
+    $c->stash->{'site_title'} = "Franks Büchersammlung";
+
+    $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
+    push @{ $c->stash->{'menu_path'} }, {
+        'path' => $c->web_path("/"),
+        'name' => "Startseite"
+    };
+
+    $c->config->{'debug_level'} = 0 unless defined $c->config->{'debug_level'};
+    #$c->log->debug( get_output_string( $K, "Aktuelle Konfiguration: ", $c->config ) ) if $c->config->{'debug_level'} >= 3;
+
+    $c->stash->{'debug_level'} = to_int( $c->config->{'debug_level'} ) || 0;
+    my $env_debug_level = to_int( $ENV{'FRBR_BOOKS_DEBUG'} || $ENV{'CATALYST_DEBUG'} );
+    $c->stash->{'debug_level'} = $env_debug_level if $env_debug_level and $env_debug_level > $c->stash->{'debug_level'};
+    $c->log->debug( $K . "Aktuelles Debug-Level: " . $c->stash->{'debug_level'} ) if $c->stash->{'debug_level'};
+
+    #$c->log->debug( get_output_string( $K . "Speicher-Objekt: ", $storage ) ) if $c->stash->{'debug_level'} >= 6;
+
+    # Feststellen, ob es eine Testumgebung ist
+    $c->stash->{'is_test_environment'} = 0;
+    if ( $c->config->{'is_test_environment'} ) {
+        $c->log->debug( $K . "TEST-Umgebung" ) if $c->stash->{'debug_level'};
+        $c->stash->{'is_test_environment'} = 1;
+    }
+
+#    $storage->sql_maker->quote_char( [qw/` `/] );
+#    $storage->sql_maker->name_sep('.');
+#
+#    my $SQL = "SET NAMES 'utf8'";
+#    warn $SQL . ";\n" if $storage->debug();
+#
+#    $storage->dbh_do(
+#        sub {
+#            my ( $storage_a, $dbh ) = @_;
+#            $dbh->do($SQL);
+#        }
+#    );
+
+    $c->session->{'last_run'} = localtime();
+
+    # Letzten und aktuellen Pfad behalten
+    my $last_path = $c->session->{'last_path'} || '';
+    my $cur_path  = $c->session->{'cur_path'}  || '';
+    my $req_path  = '/' . $c->request->path();
+    if ( $req_path ne $cur_path ) {
+        $c->session->{'last_path'} = $cur_path;
+        $c->session->{'cur_path'}  = $req_path;
+    }
+
+    # Request-URI in Sitzung einpflegen
+    $c->session->{'request'}           = {};
+    $c->session->{'request'}{'uri'}    = $c->req->uri();
+    $c->session->{'request'}{'host'}   = hostname();
+    $c->session->{'request'}{'client'} = $c->req->address();
+    $c->session->{'request'}{'uagent'} = $c->req->user_agent();
+
+    ########################
+    # Sprachabhaengige Dinge
+
+    my $lang = 'de';
+
+    # Neue Sprache festlegen:
+    if ( $c->req->param('new_lang_to_use') and $LangsToUse{ $c->req->param('new_lang_to_use') } ) {
+        $lang = $c->req->param('new_lang_to_use');
+        #$c->session->{'lang_to_use'} = $lang;
+    }
+    else {
+        #$lang = $c->session->{'lang_to_use'} if $c->session->{'lang_to_use'};
+    }
+    #$c->languages( [$lang] );
+    #$c->stash->{'lang_to_use'} = $lang;
+    #$c->log->debug( $K . "Neue Sprache: '" . $lang . "' (" . $LangsToUseInDates{$lang} . ")." ) if $c->stash->{'debug_level'} >= 2;
+
+    # Login-abhaengige Dinge
+
+    $c->stash->{'login_action'} = 'login';
+
+    if ( ( $c->controller eq $c->controller('Login') ) or ( $c->controller eq $c->controller('Logout') ) ) {
+        $c->stash->{'login_action'} = 'none';
+    }
+    elsif ( $c->user_exists ) {
+
+        my $user_info = $c->user();
+        #$c->log->debug( get_output_string( $K, "Aktueller Nutzer: ", $user_info ) ) if $c->config->{'debug_level'} >= 4;
+        my $uid       = $user_info->user_id;
+        my $user_name = $user_info->login;
+        if ( $user_info->nachname ) {
+            $user_name = $user_info->nachname;
+            $user_name = $user_info->vorname . " " . $user_name if $user_info->vorname;
+        }
+        $c->stash->{'current_user'}                     = $user_name;
+        $c->stash->{'current_user_id'}                  = $user_info->user_id;
+        $c->stash->{'login_action'}                     = 'logout';
+        $c->stash->{'current_user_is_manager'}          = 0;
+        $c->stash->{'current_user_is_human_resources'} = 0;
+        $c->stash->{'current_user_deps'}                = {};
+        $c->session->{'current_user_name'}              = $user_name;
+        $c->session->{'last_login_name'}                = $user_info->login();
+
+        #set_last_activity_time($c);
+
+        if ( $c->stash->{'debug_level'} >= 2 ) {
+            $c->log->debug( $K
+                    . "Aktuelle Nutzerinformationen:\n"
+                    . "  Name:          '" . $c->stash->{'current_user'} . "'\n"
+                    . "  Nutzer-Id:      " . $c->stash->{'current_user_id'} . "\n"
+                    . "  Ist Manager:    " . ( $c->stash->{'current_user_is_manager'} ? 'Ja' : 'Nein' ) . "\n"
+                    . "  Ist Personaler: " . ( $c->stash->{'current_user_is_human_resources'} ? 'Ja' : 'Nein' ) . "\n"
+                    . "  Abteilungen:    " . get_output_string( $c->stash->{'current_user_deps'} ) );
+        } ## end if ( $c->stash->{'debug_level'} >= 2 )
+
+    } ## end elsif ( $c->user_exists )
+
+    $c->stash->{'last_login_name'} = $c->session->{'last_login_name'};
+
+    $c->log->debug( $K . "Aktuelle Script-URL: '" . $c->stash->{'self_url'} . "'." ) if $c->stash->{'debug_level'} >= 2;
+    $c->log->debug( get_output_string( $K, "Aktueller Request: ", $c->req ) )  if $c->config->{'debug_level'} >= 3;
+
+    # Listenlaenge festlegen
+    $c->stash->{'list_length'} = $c->session->{'list_length'} || $c->config->{'default_list_length'} || 20;
+
+    # Anzahl der angezeigten zugeordneten Bücher in einer anderen Liste
+    $c->stash->{'books_in_other_list'} = $c->session->{'books_in_other_list'} || $c->config->{'default_count_books_in_other_list'} || 10;
+
+    #delete $c->stash->{'storage'} if exists $c->stash->{'storage'};
+    $c->log->debug( get_output_string( $K, "Aktuelle Session: ", $c->session ) )  if $c->config->{'debug_level'} >= 3;
+    #$c->log->debug( get_output_string( $K, "Aktueller Stash: ", $c->stash ) )  if $c->config->{'debug_level'} >= 3;
+
+    1;
+
+} ## end sub auto :
+
+#-------------------------------------------------------
+
+sub not_allowed : Local {
+
+    my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    $c->stash->{'template'} = 'not_allowed.tt2';
+
+}
+
+#---------------------------------------------------------------------------
+
 =head1 AUTHOR
 
 Frank Brehm
index 7041a1aa02f455ccee4a9edf4415b1a78ad7cc1f..6261c3823a12353f8f21090b15d813bc46770482 100644 (file)
@@ -8,7 +8,8 @@ use warnings;
 
 use base 'DBIx::Class::Schema';
 
-__PACKAGE__->load_classes;
+__PACKAGE__->load_namespaces;
+#__PACKAGE__->load_classes;
 
 
 # Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
@@ -17,28 +18,28 @@ __PACKAGE__->load_classes;
 # You can replace this text with custom content, and it will be preserved on regeneration
 #--------------------------------------------------------------------------
 
-sub connect {
-
-    my $schema = DBIx::Class::Schema::connect(@_);
-
-    return undef unless $schema;
-
-    $schema->storage->sql_maker->quote_char( [qw/` `/] );
-    $schema->storage->sql_maker->name_sep('.');
-
-    my $SQL = "SET NAMES 'utf8'";
-    warn $SQL . ";\n" if $schema->storage->debug();
-
-    $schema->storage->dbh_do(
-        sub {
-            my ( $storage, $dbh ) = @_;
-            $dbh->do($SQL);
-        }
-    );
-
-    return $schema;
-
-}
+#sub connect {
+#
+#    my $schema = DBIx::Class::Schema::connect(@_);
+#
+#    return undef unless $schema;
+#
+#    $schema->storage->sql_maker->quote_char( [qw/` `/] );
+#    $schema->storage->sql_maker->name_sep('.');
+#
+#    my $SQL = "SET NAMES 'utf8'";
+#    warn $SQL . ";\n" if $schema->storage->debug();
+#
+#    $schema->storage->dbh_do(
+#        sub {
+#            my ( $storage, $dbh ) = @_;
+#            $dbh->do($SQL);
+#        }
+#    );
+#
+#    return $schema;
+#
+#}
 
 #--------------------------------------------------------------------------
 
diff --git a/lib/FrBr/Books/Db/Autor2buch.pm b/lib/FrBr/Books/Db/Autor2buch.pm
deleted file mode 100644 (file)
index ae715c4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package FrBr::Books::Db::Autor2buch;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("autor2buch");
-__PACKAGE__->add_columns(
-  "id"       => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "buch_id"  => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "autor_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "ord_num"  => { data_type => "INT", default_value => 0,     is_nullable => 0, size => 10 },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "autor_id"]);
-
-__PACKAGE__->might_have( 'buch'  => 'FrBr::Books::Db::Buecher', { 'foreign.id' => 'self.buch_id' } );
-__PACKAGE__->might_have( 'autor' => 'FrBr::Books::Db::Autoren', { 'foreign.id' => 'self.autor_id' } );
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ndVfBKXzEtRRzVPU1qAspg
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Autoren.pm b/lib/FrBr/Books/Db/Autoren.pm
deleted file mode 100644 (file)
index 323815e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package FrBr::Books::Db::Autoren;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("autoren");
-__PACKAGE__->add_columns(
-  "id"          => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "titel"       => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
-  "vorname"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
-  "mittelname"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
-  "nachname"    => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 150, },
-  "name_suffix" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
-  "autor_descr" => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
-  "about"       => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint( "name", [ "nachname", "vorname", "mittelname", "name_suffix" ] );
-
-__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Autor2Buch', { 'foreign.autor_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'buecher' => 'autor_buch', 'buch' );
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Bindungsarten.pm b/lib/FrBr/Books/Db/Bindungsarten.pm
deleted file mode 100644 (file)
index 666dbbf..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package FrBr::Books::Db::Bindungsarten;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("bindungsarten");
-__PACKAGE__->add_columns(
-  "id"        => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "art_name"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 250, },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("art_name", ["art_name"]);
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Buch2kategorie.pm b/lib/FrBr/Books/Db/Buch2kategorie.pm
deleted file mode 100644 (file)
index 89ac0a3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package FrBr::Books::Db::Buch2kategorie;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("buch2kategorie");
-__PACKAGE__->add_columns(
-  "id"           => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "buch_id"      => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "kategorie_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "kategorie_id"]);
-
-__PACKAGE__->might_have( 'buch'      => 'FrBr::Books::Db::Buecher',    { 'foreign.id' => 'self.buch_id' } );
-__PACKAGE__->might_have( 'kategorie' => 'FrBr::Books::Db::Kategorien', { 'foreign.id' => 'self.kategorie_id' } );
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Buch2serie.pm b/lib/FrBr/Books/Db/Buch2serie.pm
deleted file mode 100644 (file)
index 2e28b26..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package FrBr::Books::Db::Buch2serie;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("buch2serie");
-__PACKAGE__->add_columns(
-  "id"        => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "buch_id"   => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "serien_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-  "ord_num"   => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "serien_id"]);
-
-
-__PACKAGE__->might_have( 'buch'  => 'FrBr::Books::Db::Buecher', { 'foreign.id' => 'self.buch_id' } );
-__PACKAGE__->might_have( 'serie' => 'FrBr::Books::Db::Serien',  { 'foreign.id' => 'self.serien_id' } );
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/BuchListe.pm b/lib/FrBr/Books/Db/BuchListe.pm
deleted file mode 100644 (file)
index 8f665ed..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-package FrBr::Books::Db::BuchListe;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-
-__PACKAGE__->table("NONE");
-
-__PACKAGE__->add_columns(
-    "id",
-    "title",
-    "title_original",
-    "untertitel",
-    "verlag",
-    "isbn",
-    "buch_nr",
-    "ausgabejahr",
-    "druckjahr",
-    "seiten",
-    "preis",
-    "verlags_id",
-    "orts_id",
-    "waehrungs_kuerzel",
-    "waehrung",
-    "ort",
-    "bindungsart",
-    "autor_ids",
-    "autoren",
-    "kategorie_ids",
-    "kategorien",
-    "serien_ids",
-    "serien",
-);
-
-__PACKAGE__->result_source_instance()->name( \<<SQL );
-( SELECT `id`,
-         `title`,
-         `title_original`,
-         `untertitel`,
-         `verlag`,
-         `isbn`,
-         `buch_nr`,
-         `ausgabejahr`,
-         `druckjahr`,
-         `seiten`,
-         `preis`,
-         `verlags_id`,
-         `orts_id`,
-         `waehrungs_kuerzel`,
-         `waehrung`,
-         `ort`,
-         `bindungsart`,
-         GROUP_CONCAT( DISTINCT `autor_id`                            SEPARATOR ', ' ) AS `autor_ids`,
-         GROUP_CONCAT( DISTINCT `autor_name` ORDER BY `autor_ord_num` SEPARATOR ', ' ) AS `autoren`,
-         GROUP_CONCAT( DISTINCT `kategorie_id`                        SEPARATOR ', ' ) AS `kategorie_ids`,
-         GROUP_CONCAT( DISTINCT `kategorie`  ORDER BY `kategorie`     SEPARATOR ', ' ) AS `kategorien`,
-         GROUP_CONCAT( DISTINCT `serien_id`                           SEPARATOR ', ' ) AS `serien_ids`,
-         GROUP_CONCAT( DISTINCT `serie`      ORDER BY `serie`         SEPARATOR ', ' ) AS `serien`
-    FROM ( SELECT b.`id`                AS `id`,
-                  b.`title`             AS `title`,
-                  b.`title_original`    AS `title_original`,
-                  b.`untertitel`        AS `untertitel`,
-                  b.`isbn`              AS `isbn`,
-                  b.`buch_nr`           AS `buch_nr`,
-                  b.`ausgabejahr`       AS `ausgabejahr`,
-                  b.`druckjahr`         AS `druckjahr`,
-                  b.`seiten`            AS `seiten`,
-                  b.`preis`             AS `preis`,
-                  b.`verlags_id`        AS `verlags_id`,
-                  b.`orts_id`           AS `orts_id`,
-                  w.`waehrungs_kuerzel` AS `waehrungs_kuerzel`,
-                  w.`waehrungs_name`    AS `waehrung`,
-                  CONCAT( '`', a.`nachname`,
-                          IF( ISNULL(a.`vorname`),     '', ' ' ), IFNULL( a.`vorname`,     '' ),
-                          IF( ISNULL(a.`mittelname`),  '', ' ' ), IFNULL( a.`mittelname`,  '' ),
-                          IF( ISNULL(a.`name_suffix`), '', ' ' ), IFNULL( a.`name_suffix`, '' ),
-                          '`'
-                  )                     AS `autor_name`,
-                  ab.`ord_num`          AS `autor_ord_num`,
-                  CONCAT( '`', a.`id`, '`' ) AS `autor_id`,
-                  a.`titel`             AS `autor_titel`,
-                  a.`vorname`           AS `autor_vorname`,
-                  a.`mittelname`        AS `autor_mittelname`,
-                  a.`nachname`          AS `autor_nachname`,
-                  a.`name_suffix`       AS `autor_name_suffix`,
-                  v.`name_short`        AS `verlag`,
-                  o.`name`              AS `ort`,
-                  CONCAT( '`', k.`id`, '`' )             AS `kategorie_id`,
-                  CONCAT( '`', k.`kategorie_name`, '`' ) AS `kategorie`,
-                  CONCAT( '`', s.`id`, '`' )             AS `serien_id`,
-                  CONCAT( '`', s.`serien_name`, '`' )    AS `serie`,
-                  bi.`art_name`         AS `bindungsart`
-             FROM autor2buch AS ab
-             LEFT  JOIN `autoren`        a  ON ab.`autor_id` = a.`id`
-             RIGHT JOIN `buecher`        b  ON ab.`buch_id`  = b.`id`
-             LEFT  JOIN `bindungsarten`  bi ON b.`bindungsart_id` = bi.`id`
-             LEFT  JOIN `verlage`        v  ON b.`verlags_id` = v.`id`
-             LEFT  JOIN `orte`           o  ON b.`orts_id` = o.`id`
-             LEFT  JOIN `waehrungen`     w  ON b.`waehrungs_id` = w.`id`
-             LEFT  JOIN `buch2kategorie` bk ON b.`id` = bk.`buch_id`
-             LEFT  JOIN `kategorien`     k  ON k.`id` = bk.`kategorie_id`
-             LEFT  JOIN `buch2serie`     bs ON b.`id` = bs.`buch_id`
-             LEFT  JOIN `serien`         s  ON s.`id` = bs.`serien_id`
-    ) AS `a`
-  GROUP BY `id`
-)
-SQL
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Buecher.pm b/lib/FrBr/Books/Db/Buecher.pm
deleted file mode 100644 (file)
index b645447..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-package FrBr::Books::Db::Buecher;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("buecher");
-__PACKAGE__->add_columns(
-  "id"             => { data_type => "INT",       default_value => undef, is_nullable => 0, size => 10 },
-  "title"          => { data_type => "VARCHAR",   default_value => undef, is_nullable => 0, size => 250, },
-  "title_original" => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 250, },
-  "untertitel"     => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 250, },
-  "bindungsart_id" => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
-  "verlags_id"     => { data_type => "INT",       default_value => undef, is_nullable => 0, size => 10 },
-  "orts_id"        => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
-  "isbn"           => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 20, },
-  "buch_nr"        => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 100, },
-  "ausgabejahr"    => { data_type => "MEDIUMINT", default_value => undef, is_nullable => 1, size => 8, },
-  "druckjahr"      => { data_type => "MEDIUMINT", default_value => undef, is_nullable => 1, size => 8, },
-  "seiten"         => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
-  "preis"          => { data_type => "FLOAT",     default_value => undef, is_nullable => 1, size => 32 },
-  "waehrungs_id"   => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
-  "kurzinhalt"     => { data_type => "TEXT",      default_value => undef, is_nullable => 1, size => 65535, },
-);
-
-__PACKAGE__->set_primary_key("id");
-
-__PACKAGE__->might_have( 'waehrung'    => 'FrBr::Books::Db::Waehrungen',    { 'foreign.id' => 'self.waehrungs_id' } );
-__PACKAGE__->might_have( 'verlag'      => 'FrBr::Books::Db::Verlage',       { 'foreign.id' => 'self.verlags_id' } );
-__PACKAGE__->might_have( 'ort'         => 'FrBr::Books::Db::Orte',          { 'foreign.id' => 'self.orts_id' } );
-__PACKAGE__->might_have( 'bindungsart' => 'FrBr::Books::Db::Bindungsarten', { 'foreign.id' => 'self.bindungsart_id' } );
-
-__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Autor2Buch', { 'foreign.buch_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'autoren' => 'autor_buch', 'autor' );
-
-__PACKAGE__->has_many( 'buch_kategorie' => 'FrBr::Books::Db::Buch2kategorie', { 'foreign.buch_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'kategorien' => 'buch_kategorie', 'kategorie' );
-
-__PACKAGE__->has_many( 'buch_serie' => 'FrBr::Books::Db::Buch2serie', { 'foreign.buch_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'serien' => 'buch_serie', 'serie' );
-
-=pod
-
-# Make a new ResultSource based on the buecher class
-my $source = __PACKAGE__->result_source_instance();
-my $list_source = $source->new( $source );
-$list_source->source_name( 'BuchListe' );
-
-# Hand in your query as a scalar reference
-# It will be added as a sub-select after FROM,
-# so pay attention to the surrounding brackets!
-$list_source->name( \<<SQL );
-( SELECT `id`,
-         `title`,
-         `title_original`,
-         `untertitel`,
-         `verlag`,
-         `isbn`,
-         `buch_nr`,
-         `ausgabejahr`,
-         `druckjahr`,
-         `seiten`,
-         `preis`,
-         `waehrungs_kuerzel`,
-         `waehrung`,
-         `ort`,
-         `bindungsart`,
-         GROUP_CONCAT( DISTINCT `autor_id`                            SEPARATOR ', ' ) AS `autor_ids`,
-         GROUP_CONCAT( DISTINCT `autor_name` ORDER BY `autor_ord_num` SEPARATOR ', ' ) AS `autoren`,
-         GROUP_CONCAT( DISTINCT `kategorie_id`                        SEPARATOR ', ' ) AS `kategorie_ids`,
-         GROUP_CONCAT( DISTINCT `kategorie`  ORDER BY `kategorie`     SEPARATOR ', ' ) AS `kategorien`,
-         GROUP_CONCAT( DISTINCT `serien_id`                           SEPARATOR ', ' ) AS `serien_ids`,
-         GROUP_CONCAT( DISTINCT `serie`      ORDER BY `serie`         SEPARATOR ', ' ) AS `serien`
-    FROM ( SELECT b.`id`                AS `id`,
-                  b.`title`             AS `title`,
-                  b.`title_original`    AS `title_original`,
-                  b.`untertitel`        AS `untertitel`,
-                  b.`isbn`              AS `isbn`,
-                  b.`buch_nr`           AS `buch_nr`,
-                  b.`ausgabejahr`       AS `ausgabejahr`,
-                  b.`druckjahr`         AS `druckjahr`,
-                  b.`seiten`            AS `seiten`,
-                  b.`preis`             AS `preis`,
-                  w.`waehrungs_kuerzel` AS `waehrungs_kuerzel`,
-                  w.`waehrungs_name`    AS `waehrung`,
-                  CONCAT( '`', a.`nachname`,
-                          IF( ISNULL(a.`vorname`),     '', ' ' ), IFNULL( a.`vorname`,     '' ),
-                          IF( ISNULL(a.`mittelname`),  '', ' ' ), IFNULL( a.`mittelname`,  '' ),
-                          IF( ISNULL(a.`name_suffix`), '', ' ' ), IFNULL( a.`name_suffix`, '' ),
-                          '`'
-                  )                     AS `autor_name`,
-                  ab.`ord_num`          AS `autor_ord_num`,
-                  CONCAT( '`', a.`id`, '`' ) AS `autor_id`,
-                  a.`titel`             AS `autor_titel`,
-                  a.`vorname`           AS `autor_vorname`,
-                  a.`mittelname`        AS `autor_mittelname`,
-                  a.`nachname`          AS `autor_nachname`,
-                  a.`name_suffix`       AS `autor_name_suffix`,
-                  v.`name_short`        AS `verlag`,
-                  o.`name`              AS `ort`,
-                  CONCAT( '`', k.`id`, '`' )             AS `kategorie_id`,
-                  CONCAT( '`', k.`kategorie_name`, '`' ) AS `kategorie`,
-                  CONCAT( '`', s.`id`, '`' )             AS `serien_id`,
-                  CONCAT( '`', s.`serien_name`, '`' )    AS `serie`,
-                  bi.`art_name`         AS `bindungsart`
-             FROM autor2buch AS ab
-             LEFT  JOIN `autoren`        a  ON ab.`autor_id` = a.`id`
-             RIGHT JOIN `buecher`        b  ON ab.`buch_id`  = b.`id`
-             LEFT  JOIN `bindungsarten`  bi ON b.`bindungsart_id` = bi.`id`
-             LEFT  JOIN `verlage`        v  ON b.`verlags_id` = v.`id`
-             LEFT  JOIN `orte`           o  ON b.`orts_id` = o.`id`
-             LEFT  JOIN `waehrungen`     w  ON b.`waehrungs_id` = w.`id`
-             LEFT  JOIN `buch2kategorie` bk ON b.`id` = bk.`buch_id`
-             LEFT  JOIN `kategorien`     k  ON k.`id` = bk.`kategorie_id`
-             LEFT  JOIN `buch2serie`     bs ON b.`id` = bs.`buch_id`
-             LEFT  JOIN `serien`         s  ON s.`id` = bs.`serien_id`
-    ) AS `a`
-  GROUP BY `id`
-)
-SQL
-
-# Finally, register your new ResultSource with your Schema
-FrBr::Books::Db->register_source( 'BuchListe' => $list_source );
-
-=cut
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Kategorien.pm b/lib/FrBr/Books/Db/Kategorien.pm
deleted file mode 100644 (file)
index 0d83442..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package FrBr::Books::Db::Kategorien;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("kategorien");
-__PACKAGE__->add_columns(
-  "id"             => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "kategorie_name" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("kategorie_name", ["kategorie_name"]);
-
-
-__PACKAGE__->has_many( 'buch_kategorie' => 'FrBr::Books::Db::Buch2kategorie', { 'foreign.kategorie_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'buecher' => 'buch_kategorie', 'buch' );
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Orte.pm b/lib/FrBr/Books/Db/Orte.pm
deleted file mode 100644 (file)
index 015fd52..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package FrBr::Books::Db::Orte;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("orte");
-__PACKAGE__->add_columns(
-  "id"       => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "name"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
-  "descr"    => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
-  "statisch" => { data_type => "ENUM",    default_value => "n",   is_nullable => 0, size => 1 },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("name", ["name"]);
-
-
-__PACKAGE__->has_many( 'buecher' => 'FrBr::Books::Db::Buecher', { 'foreign.orts_id' => 'self.id' } );
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QwPjYKNwUnR5b418xxulDg
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Autor2buch.pm b/lib/FrBr/Books/Db/Result/Autor2buch.pm
new file mode 100644 (file)
index 0000000..9a31124
--- /dev/null
@@ -0,0 +1,34 @@
+package FrBr::Books::Db::Result::Autor2buch;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("autor2buch");
+__PACKAGE__->add_columns(
+  "id"       => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "buch_id"  => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "autor_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "ord_num"  => { data_type => "INT", default_value => 0,     is_nullable => 0, size => 10 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "autor_id"]);
+
+__PACKAGE__->might_have( 'buch'  => 'FrBr::Books::Db::Result::Buecher', { 'foreign.id' => 'self.buch_id' } );
+__PACKAGE__->might_have( 'autor' => 'FrBr::Books::Db::Result::Autoren', { 'foreign.id' => 'self.autor_id' } );
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ndVfBKXzEtRRzVPU1qAspg
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Autoren.pm b/lib/FrBr/Books/Db/Result/Autoren.pm
new file mode 100644 (file)
index 0000000..682f7f6
--- /dev/null
@@ -0,0 +1,34 @@
+package FrBr::Books::Db::Result::Autoren;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("autoren");
+__PACKAGE__->add_columns(
+  "id"          => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "titel"       => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
+  "vorname"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
+  "mittelname"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
+  "nachname"    => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 150, },
+  "name_suffix" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
+  "autor_descr" => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
+  "about"       => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint( "name", [ "nachname", "vorname", "mittelname", "name_suffix" ] );
+
+__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Result::Autor2Buch', { 'foreign.autor_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'buecher' => 'autor_buch', 'buch' );
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Bindungsarten.pm b/lib/FrBr/Books/Db/Result/Bindungsarten.pm
new file mode 100644 (file)
index 0000000..d632d96
--- /dev/null
@@ -0,0 +1,24 @@
+package FrBr::Books::Db::Result::Bindungsarten;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("bindungsarten");
+__PACKAGE__->add_columns(
+  "id"        => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "art_name"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 250, },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("art_name", ["art_name"]);
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Buch2kategorie.pm b/lib/FrBr/Books/Db/Result/Buch2kategorie.pm
new file mode 100644 (file)
index 0000000..b83d314
--- /dev/null
@@ -0,0 +1,28 @@
+package FrBr::Books::Db::Result::Buch2kategorie;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("buch2kategorie");
+__PACKAGE__->add_columns(
+  "id"           => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "buch_id"      => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "kategorie_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "kategorie_id"]);
+
+__PACKAGE__->might_have( 'buch'      => 'FrBr::Books::Db::Result::Buecher',    { 'foreign.id' => 'self.buch_id' } );
+__PACKAGE__->might_have( 'kategorie' => 'FrBr::Books::Db::Result::Kategorien', { 'foreign.id' => 'self.kategorie_id' } );
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Buch2serie.pm b/lib/FrBr/Books/Db/Result/Buch2serie.pm
new file mode 100644 (file)
index 0000000..9b556b9
--- /dev/null
@@ -0,0 +1,30 @@
+package FrBr::Books::Db::Result::Buch2serie;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("buch2serie");
+__PACKAGE__->add_columns(
+  "id"        => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "buch_id"   => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "serien_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+  "ord_num"   => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("buch_id", ["buch_id", "serien_id"]);
+
+
+__PACKAGE__->might_have( 'buch'  => 'FrBr::Books::Db::Result::Buecher', { 'foreign.id' => 'self.buch_id' } );
+__PACKAGE__->might_have( 'serie' => 'FrBr::Books::Db::Result::Serien',  { 'foreign.id' => 'self.serien_id' } );
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/BuchListe.pm b/lib/FrBr/Books/Db/Result/BuchListe.pm
new file mode 100644 (file)
index 0000000..abb2298
--- /dev/null
@@ -0,0 +1,119 @@
+package FrBr::Books::Db::Result::BuchListe;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+
+__PACKAGE__->table("NONE");
+
+__PACKAGE__->add_columns(
+    "id",
+    "title",
+    "title_original",
+    "untertitel",
+    "verlag",
+    "isbn",
+    "buch_nr",
+    "ausgabejahr",
+    "druckjahr",
+    "seiten",
+    "preis",
+    "verlags_id",
+    "orts_id",
+    "waehrungs_kuerzel",
+    "waehrung",
+    "ort",
+    "bindungsart",
+    "autor_ids",
+    "autoren",
+    "kategorie_ids",
+    "kategorien",
+    "serien_ids",
+    "serien",
+);
+
+__PACKAGE__->result_source_instance()->name( \<<SQL );
+( SELECT `id`,
+         `title`,
+         `title_original`,
+         `untertitel`,
+         `verlag`,
+         `isbn`,
+         `buch_nr`,
+         `ausgabejahr`,
+         `druckjahr`,
+         `seiten`,
+         `preis`,
+         `verlags_id`,
+         `orts_id`,
+         `waehrungs_kuerzel`,
+         `waehrung`,
+         `ort`,
+         `bindungsart`,
+         GROUP_CONCAT( DISTINCT `autor_id`                            SEPARATOR ', ' ) AS `autor_ids`,
+         GROUP_CONCAT( DISTINCT `autor_name` ORDER BY `autor_ord_num` SEPARATOR ', ' ) AS `autoren`,
+         GROUP_CONCAT( DISTINCT `kategorie_id`                        SEPARATOR ', ' ) AS `kategorie_ids`,
+         GROUP_CONCAT( DISTINCT `kategorie`  ORDER BY `kategorie`     SEPARATOR ', ' ) AS `kategorien`,
+         GROUP_CONCAT( DISTINCT `serien_id`                           SEPARATOR ', ' ) AS `serien_ids`,
+         GROUP_CONCAT( DISTINCT `serie`      ORDER BY `serie`         SEPARATOR ', ' ) AS `serien`
+    FROM ( SELECT b.`id`                AS `id`,
+                  b.`title`             AS `title`,
+                  b.`title_original`    AS `title_original`,
+                  b.`untertitel`        AS `untertitel`,
+                  b.`isbn`              AS `isbn`,
+                  b.`buch_nr`           AS `buch_nr`,
+                  b.`ausgabejahr`       AS `ausgabejahr`,
+                  b.`druckjahr`         AS `druckjahr`,
+                  b.`seiten`            AS `seiten`,
+                  b.`preis`             AS `preis`,
+                  b.`verlags_id`        AS `verlags_id`,
+                  b.`orts_id`           AS `orts_id`,
+                  w.`waehrungs_kuerzel` AS `waehrungs_kuerzel`,
+                  w.`waehrungs_name`    AS `waehrung`,
+                  CONCAT( '`', a.`nachname`,
+                          IF( ISNULL(a.`vorname`),     '', ' ' ), IFNULL( a.`vorname`,     '' ),
+                          IF( ISNULL(a.`mittelname`),  '', ' ' ), IFNULL( a.`mittelname`,  '' ),
+                          IF( ISNULL(a.`name_suffix`), '', ' ' ), IFNULL( a.`name_suffix`, '' ),
+                          '`'
+                  )                     AS `autor_name`,
+                  ab.`ord_num`          AS `autor_ord_num`,
+                  CONCAT( '`', a.`id`, '`' ) AS `autor_id`,
+                  a.`titel`             AS `autor_titel`,
+                  a.`vorname`           AS `autor_vorname`,
+                  a.`mittelname`        AS `autor_mittelname`,
+                  a.`nachname`          AS `autor_nachname`,
+                  a.`name_suffix`       AS `autor_name_suffix`,
+                  v.`name_short`        AS `verlag`,
+                  o.`name`              AS `ort`,
+                  CONCAT( '`', k.`id`, '`' )             AS `kategorie_id`,
+                  CONCAT( '`', k.`kategorie_name`, '`' ) AS `kategorie`,
+                  CONCAT( '`', s.`id`, '`' )             AS `serien_id`,
+                  CONCAT( '`', s.`serien_name`, '`' )    AS `serie`,
+                  bi.`art_name`         AS `bindungsart`
+             FROM autor2buch AS ab
+             LEFT  JOIN `autoren`        a  ON ab.`autor_id` = a.`id`
+             RIGHT JOIN `buecher`        b  ON ab.`buch_id`  = b.`id`
+             LEFT  JOIN `bindungsarten`  bi ON b.`bindungsart_id` = bi.`id`
+             LEFT  JOIN `verlage`        v  ON b.`verlags_id` = v.`id`
+             LEFT  JOIN `orte`           o  ON b.`orts_id` = o.`id`
+             LEFT  JOIN `waehrungen`     w  ON b.`waehrungs_id` = w.`id`
+             LEFT  JOIN `buch2kategorie` bk ON b.`id` = bk.`buch_id`
+             LEFT  JOIN `kategorien`     k  ON k.`id` = bk.`kategorie_id`
+             LEFT  JOIN `buch2serie`     bs ON b.`id` = bs.`buch_id`
+             LEFT  JOIN `serien`         s  ON s.`id` = bs.`serien_id`
+    ) AS `a`
+  GROUP BY `id`
+)
+SQL
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Buecher.pm b/lib/FrBr/Books/Db/Result/Buecher.pm
new file mode 100644 (file)
index 0000000..fd404b6
--- /dev/null
@@ -0,0 +1,136 @@
+package FrBr::Books::Db::Result::Buecher;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("buecher");
+__PACKAGE__->add_columns(
+  "id"             => { data_type => "INT",       default_value => undef, is_nullable => 0, size => 10 },
+  "title"          => { data_type => "VARCHAR",   default_value => undef, is_nullable => 0, size => 250, },
+  "title_original" => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 250, },
+  "untertitel"     => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 250, },
+  "bindungsart_id" => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
+  "verlags_id"     => { data_type => "INT",       default_value => undef, is_nullable => 0, size => 10 },
+  "orts_id"        => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
+  "isbn"           => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 20, },
+  "buch_nr"        => { data_type => "VARCHAR",   default_value => undef, is_nullable => 1, size => 100, },
+  "ausgabejahr"    => { data_type => "MEDIUMINT", default_value => undef, is_nullable => 1, size => 8, },
+  "druckjahr"      => { data_type => "MEDIUMINT", default_value => undef, is_nullable => 1, size => 8, },
+  "seiten"         => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
+  "preis"          => { data_type => "FLOAT",     default_value => undef, is_nullable => 1, size => 32 },
+  "waehrungs_id"   => { data_type => "INT",       default_value => undef, is_nullable => 1, size => 10 },
+  "kurzinhalt"     => { data_type => "TEXT",      default_value => undef, is_nullable => 1, size => 65535, },
+);
+
+__PACKAGE__->set_primary_key("id");
+
+__PACKAGE__->might_have( 'waehrung'    => 'FrBr::Books::Db::Result::Waehrungen',    { 'foreign.id' => 'self.waehrungs_id' } );
+__PACKAGE__->might_have( 'verlag'      => 'FrBr::Books::Db::Result::Verlage',       { 'foreign.id' => 'self.verlags_id' } );
+__PACKAGE__->might_have( 'ort'         => 'FrBr::Books::Db::Result::Orte',          { 'foreign.id' => 'self.orts_id' } );
+__PACKAGE__->might_have( 'bindungsart' => 'FrBr::Books::Db::Result::Bindungsarten', { 'foreign.id' => 'self.bindungsart_id' } );
+
+__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Result::Autor2Buch', { 'foreign.buch_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'autoren' => 'autor_buch', 'autor' );
+
+__PACKAGE__->has_many( 'buch_kategorie' => 'FrBr::Books::Db::Result::Buch2kategorie', { 'foreign.buch_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'kategorien' => 'buch_kategorie', 'kategorie' );
+
+__PACKAGE__->has_many( 'buch_serie' => 'FrBr::Books::Db::Result::Buch2serie', { 'foreign.buch_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'serien' => 'buch_serie', 'serie' );
+
+=pod
+
+# Make a new ResultSource based on the buecher class
+my $source = __PACKAGE__->result_source_instance();
+my $list_source = $source->new( $source );
+$list_source->source_name( 'BuchListe' );
+
+# Hand in your query as a scalar reference
+# It will be added as a sub-select after FROM,
+# so pay attention to the surrounding brackets!
+$list_source->name( \<<SQL );
+( SELECT `id`,
+         `title`,
+         `title_original`,
+         `untertitel`,
+         `verlag`,
+         `isbn`,
+         `buch_nr`,
+         `ausgabejahr`,
+         `druckjahr`,
+         `seiten`,
+         `preis`,
+         `waehrungs_kuerzel`,
+         `waehrung`,
+         `ort`,
+         `bindungsart`,
+         GROUP_CONCAT( DISTINCT `autor_id`                            SEPARATOR ', ' ) AS `autor_ids`,
+         GROUP_CONCAT( DISTINCT `autor_name` ORDER BY `autor_ord_num` SEPARATOR ', ' ) AS `autoren`,
+         GROUP_CONCAT( DISTINCT `kategorie_id`                        SEPARATOR ', ' ) AS `kategorie_ids`,
+         GROUP_CONCAT( DISTINCT `kategorie`  ORDER BY `kategorie`     SEPARATOR ', ' ) AS `kategorien`,
+         GROUP_CONCAT( DISTINCT `serien_id`                           SEPARATOR ', ' ) AS `serien_ids`,
+         GROUP_CONCAT( DISTINCT `serie`      ORDER BY `serie`         SEPARATOR ', ' ) AS `serien`
+    FROM ( SELECT b.`id`                AS `id`,
+                  b.`title`             AS `title`,
+                  b.`title_original`    AS `title_original`,
+                  b.`untertitel`        AS `untertitel`,
+                  b.`isbn`              AS `isbn`,
+                  b.`buch_nr`           AS `buch_nr`,
+                  b.`ausgabejahr`       AS `ausgabejahr`,
+                  b.`druckjahr`         AS `druckjahr`,
+                  b.`seiten`            AS `seiten`,
+                  b.`preis`             AS `preis`,
+                  w.`waehrungs_kuerzel` AS `waehrungs_kuerzel`,
+                  w.`waehrungs_name`    AS `waehrung`,
+                  CONCAT( '`', a.`nachname`,
+                          IF( ISNULL(a.`vorname`),     '', ' ' ), IFNULL( a.`vorname`,     '' ),
+                          IF( ISNULL(a.`mittelname`),  '', ' ' ), IFNULL( a.`mittelname`,  '' ),
+                          IF( ISNULL(a.`name_suffix`), '', ' ' ), IFNULL( a.`name_suffix`, '' ),
+                          '`'
+                  )                     AS `autor_name`,
+                  ab.`ord_num`          AS `autor_ord_num`,
+                  CONCAT( '`', a.`id`, '`' ) AS `autor_id`,
+                  a.`titel`             AS `autor_titel`,
+                  a.`vorname`           AS `autor_vorname`,
+                  a.`mittelname`        AS `autor_mittelname`,
+                  a.`nachname`          AS `autor_nachname`,
+                  a.`name_suffix`       AS `autor_name_suffix`,
+                  v.`name_short`        AS `verlag`,
+                  o.`name`              AS `ort`,
+                  CONCAT( '`', k.`id`, '`' )             AS `kategorie_id`,
+                  CONCAT( '`', k.`kategorie_name`, '`' ) AS `kategorie`,
+                  CONCAT( '`', s.`id`, '`' )             AS `serien_id`,
+                  CONCAT( '`', s.`serien_name`, '`' )    AS `serie`,
+                  bi.`art_name`         AS `bindungsart`
+             FROM autor2buch AS ab
+             LEFT  JOIN `autoren`        a  ON ab.`autor_id` = a.`id`
+             RIGHT JOIN `buecher`        b  ON ab.`buch_id`  = b.`id`
+             LEFT  JOIN `bindungsarten`  bi ON b.`bindungsart_id` = bi.`id`
+             LEFT  JOIN `verlage`        v  ON b.`verlags_id` = v.`id`
+             LEFT  JOIN `orte`           o  ON b.`orts_id` = o.`id`
+             LEFT  JOIN `waehrungen`     w  ON b.`waehrungs_id` = w.`id`
+             LEFT  JOIN `buch2kategorie` bk ON b.`id` = bk.`buch_id`
+             LEFT  JOIN `kategorien`     k  ON k.`id` = bk.`kategorie_id`
+             LEFT  JOIN `buch2serie`     bs ON b.`id` = bs.`buch_id`
+             LEFT  JOIN `serien`         s  ON s.`id` = bs.`serien_id`
+    ) AS `a`
+  GROUP BY `id`
+)
+SQL
+
+# Finally, register your new ResultSource with your Schema
+FrBr::Books::Db->register_source( 'BuchListe' => $list_source );
+
+=cut
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Kategorien.pm b/lib/FrBr/Books/Db/Result/Kategorien.pm
new file mode 100644 (file)
index 0000000..afb4e8d
--- /dev/null
@@ -0,0 +1,28 @@
+package FrBr::Books::Db::Result::Kategorien;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("kategorien");
+__PACKAGE__->add_columns(
+  "id"             => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "kategorie_name" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("kategorie_name", ["kategorie_name"]);
+
+
+__PACKAGE__->has_many( 'buch_kategorie' => 'FrBr::Books::Db::Result::Buch2kategorie', { 'foreign.kategorie_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'buecher' => 'buch_kategorie', 'buch' );
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Orte.pm b/lib/FrBr/Books/Db/Result/Orte.pm
new file mode 100644 (file)
index 0000000..349bf96
--- /dev/null
@@ -0,0 +1,34 @@
+package FrBr::Books::Db::Result::Orte;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("orte");
+__PACKAGE__->add_columns(
+  "id"       => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "name"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
+  "descr"    => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
+  "statisch" => { data_type => "ENUM",    default_value => "n",   is_nullable => 0, size => 1 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("name", ["name"]);
+
+
+__PACKAGE__->has_many( 'buecher' => 'FrBr::Books::Db::Result::Buecher', { 'foreign.orts_id' => 'self.id' } );
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QwPjYKNwUnR5b418xxulDg
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Serien.pm b/lib/FrBr/Books/Db/Result/Serien.pm
new file mode 100644 (file)
index 0000000..56c6e58
--- /dev/null
@@ -0,0 +1,34 @@
+package FrBr::Books::Db::Result::Serien;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("serien");
+__PACKAGE__->add_columns(
+  "id"          => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "serien_name" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
+  "descr"       => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("serien_name", ["serien_name"]);
+
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/IzPoWKb7jK+P2HCTO+bCQ
+
+__PACKAGE__->has_many( 'buch_serie' => 'FrBr::Books::Db::Result::Buch2serie', { 'foreign.serien_id' => 'self.id' } );
+__PACKAGE__->many_to_many( 'buecher' => 'buch_serie', 'buch' );
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Session.pm b/lib/FrBr/Books/Db/Result/Session.pm
new file mode 100644 (file)
index 0000000..c16e622
--- /dev/null
@@ -0,0 +1,30 @@
+package FrBr::Books::Db::Result::Session;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("session");
+__PACKAGE__->add_columns(
+  "id"           => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 72, },
+  "session_data" => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
+  "expires"      => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+);
+__PACKAGE__->set_primary_key("id");
+
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iRa1VUPKms1GfHni1F3KoA
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/UserAdd.pm b/lib/FrBr/Books/Db/Result/UserAdd.pm
new file mode 100644 (file)
index 0000000..8ec48cd
--- /dev/null
@@ -0,0 +1,27 @@
+package FrBr::Books::Db::Result::UserAdd;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("user_add");
+__PACKAGE__->add_columns(
+  "user_id"  => { data_type => "INT",  default_value => undef, is_nullable => 0, size => 10 },
+  "comments" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
+  "prefs"    => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
+);
+__PACKAGE__->set_primary_key("user_id");
+
+__PACKAGE__->might_have( 'user' => 'FrBr::Books::Db::Result::Users', { 'foreign.user_id' => 'self.user_id' } );
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Users.pm b/lib/FrBr/Books/Db/Result/Users.pm
new file mode 100644 (file)
index 0000000..d2375cb
--- /dev/null
@@ -0,0 +1,39 @@
+package FrBr::Books::Db::Result::Users;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("users");
+__PACKAGE__->add_columns(
+  "user_id"      => { data_type => "INT",      default_value => undef, is_nullable => 0, size => 10 },
+  "login"        => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 50, },
+  "vorname"      => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 100, },
+  "nachname"     => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 100, },
+  "password"     => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 250, },
+  "date_created" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+  "date_changed" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+  "email"        => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 250, },
+  "deleted"      => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
+  "enabled"      => { data_type => "ENUM",     default_value => "y",   is_nullable => 0, size => 1 },
+  "admin_status" => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
+);
+__PACKAGE__->set_primary_key("user_id");
+__PACKAGE__->add_unique_constraint("login", ["login"]);
+
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dE3Et+cb9hDWcDvAu7CS+A
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Result/Verlage.pm b/lib/FrBr/Books/Db/Result/Verlage.pm
new file mode 100644 (file)
index 0000000..9db610c
--- /dev/null
@@ -0,0 +1,27 @@
+package FrBr::Books::Db::Result::Verlage;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("verlage");
+__PACKAGE__->add_columns(
+  "id"         => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "name_short" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 50, },
+  "name_long"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 250, },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("name_short", ["name_short"]);
+
+__PACKAGE__->has_many( 'buecher' => 'FrBr::Books::Db::Result::Buecher', { 'foreign.verlags_id' => 'self.id' } );
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl
diff --git a/lib/FrBr/Books/Db/Result/Waehrungen.pm b/lib/FrBr/Books/Db/Result/Waehrungen.pm
new file mode 100644 (file)
index 0000000..4fb81ce
--- /dev/null
@@ -0,0 +1,32 @@
+package FrBr::Books::Db::Result::Waehrungen;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("waehrungen");
+__PACKAGE__->add_columns(
+  "id"                 => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
+  "waehrungs_kuerzel"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 10, },
+  "waehrungs_name"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
+  "umrechnung_in_euro" => { data_type => "FLOAT",   default_value => undef, is_nullable => 1, size => 32 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("waehrungs_kuerzel", ["waehrungs_kuerzel"]);
+
+
+# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WM0GK+E0U+7khRuX5LN3XA
+
+
+# You can replace this text with custom content, and it will be preserved on regeneration
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Serien.pm b/lib/FrBr/Books/Db/Serien.pm
deleted file mode 100644 (file)
index b67b930..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package FrBr::Books::Db::Serien;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("serien");
-__PACKAGE__->add_columns(
-  "id"          => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "serien_name" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
-  "descr"       => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("serien_name", ["serien_name"]);
-
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/IzPoWKb7jK+P2HCTO+bCQ
-
-__PACKAGE__->has_many( 'buch_serie' => 'FrBr::Books::Db::Buch2serie', { 'foreign.serien_id' => 'self.id' } );
-__PACKAGE__->many_to_many( 'buecher' => 'buch_serie', 'buch' );
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Session.pm b/lib/FrBr/Books/Db/Session.pm
deleted file mode 100644 (file)
index 7189892..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package FrBr::Books::Db::Session;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("session");
-__PACKAGE__->add_columns(
-  "id"           => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 72, },
-  "session_data" => { data_type => "TEXT",    default_value => undef, is_nullable => 0, size => 65535, },
-  "expires"      => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-);
-__PACKAGE__->set_primary_key("id");
-
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iRa1VUPKms1GfHni1F3KoA
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/UserAdd.pm b/lib/FrBr/Books/Db/UserAdd.pm
deleted file mode 100644 (file)
index 9d97f83..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package FrBr::Books::Db::UserAdd;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("user_add");
-__PACKAGE__->add_columns(
-  "user_id"  => { data_type => "INT",  default_value => undef, is_nullable => 0, size => 10 },
-  "comments" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
-  "prefs"    => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
-);
-__PACKAGE__->set_primary_key("user_id");
-
-__PACKAGE__->might_have( 'user' => 'FrBr::Books::Db::Users', { 'foreign.user_id' => 'self.user_id' } );
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Users.pm b/lib/FrBr/Books/Db/Users.pm
deleted file mode 100644 (file)
index 9359ee8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package FrBr::Books::Db::Users;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("users");
-__PACKAGE__->add_columns(
-  "user_id"      => { data_type => "INT",      default_value => undef, is_nullable => 0, size => 10 },
-  "login"        => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 50, },
-  "vorname"      => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 100, },
-  "nachname"     => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 100, },
-  "password"     => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 250, },
-  "date_created" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
-  "date_changed" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
-  "email"        => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 250, },
-  "deleted"      => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
-  "enabled"      => { data_type => "ENUM",     default_value => "y",   is_nullable => 0, size => 1 },
-  "admin_status" => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
-);
-__PACKAGE__->set_primary_key("user_id");
-__PACKAGE__->add_unique_constraint("login", ["login"]);
-
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dE3Et+cb9hDWcDvAu7CS+A
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
diff --git a/lib/FrBr/Books/Db/Verlage.pm b/lib/FrBr/Books/Db/Verlage.pm
deleted file mode 100644 (file)
index 230d32c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package FrBr::Books::Db::Verlage;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("verlage");
-__PACKAGE__->add_columns(
-  "id"         => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "name_short" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 50, },
-  "name_long"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 250, },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("name_short", ["name_short"]);
-
-__PACKAGE__->has_many( 'buecher' => 'FrBr::Books::Db::Buecher', { 'foreign.verlags_id' => 'self.id' } );
-
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl
diff --git a/lib/FrBr/Books/Db/Waehrungen.pm b/lib/FrBr/Books/Db/Waehrungen.pm
deleted file mode 100644 (file)
index 7140fa9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package FrBr::Books::Db::Waehrungen;
-
-# $Id$
-# $URL$
-
-use strict;
-use warnings;
-
-use base 'DBIx::Class';
-
-__PACKAGE__->load_components("Core");
-__PACKAGE__->table("waehrungen");
-__PACKAGE__->add_columns(
-  "id"                 => { data_type => "INT",     default_value => undef, is_nullable => 0, size => 10 },
-  "waehrungs_kuerzel"  => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 10, },
-  "waehrungs_name"     => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 100, },
-  "umrechnung_in_euro" => { data_type => "FLOAT",   default_value => undef, is_nullable => 1, size => 32 },
-);
-__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("waehrungs_kuerzel", ["waehrungs_kuerzel"]);
-
-
-# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WM0GK+E0U+7khRuX5LN3XA
-
-
-# You can replace this text with custom content, and it will be preserved on regeneration
-1;
-
-__END__
-
-# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
index 92efcfd7cc4cc934d7605e5ccd2791a14a0965f8..649223b2928c0a34b599e4ef75e3165d7a60554b 100644 (file)
@@ -5,15 +5,8 @@ package FrBr::Books::Plugin::ConfigLoader;
 
 use base "Catalyst::Plugin::ConfigLoader";
 use FrBr::Common;
-use Catalyst::Log::Log4perl;
 
-my %LogLevels = (
-    'FATAL' => 1,
-    'ERROR' => 1,
-    'WARN'  => 1,
-    'INFO'  => 1,
-    'DEBUG' => 1,
-);
+our $VERSION = '0.03';
 
 #---------------------------------------------------------------------------
 
@@ -35,9 +28,9 @@ C<$c-E<gt>path_to('foo', 'bar')>
 sub finalize_config {
 
     my $c = shift;
-    my $K = __PACKAGE__ . "::finalize_config(): ";
+    my $K = ( caller(0) )[3] . "(): ";
 
-    #$c->log->debug( get_output_string( $K, "aufgerufen." ) ) if $c->config->{'debug_level'} >= 2;
+    $c->log->debug( get_output_string( $K, "aufgerufen." ) );
 
     $c->SUPER::finalize_config();
 
@@ -46,31 +39,7 @@ sub finalize_config {
     # Vorgabe-View festlegen (kann mit $c->stash->{'current_view_instance'} oder $c->stash->{'current_view'} ueberschrieben werden.)
     $c->config()->{'default_view'} = 'TtDefault' unless $c->config()->{'default_view'};
 
-    my $log4perlconf = "";
-    my $log_level = uc( $c->config()->{'log_level'} || 'info' );
-    $log_level = 'INFO' unless $LogLevels{$log_level};
-
-    if ( $ENV{'CATALYST_DEBUG'} or $ENV{'FRBR_BOOKS_DEBUG'} ) {
-        $log_level = 'DEBUG';
-    }
-    else {
-        $log_level = 'INFO' if $log_level eq 'DEBUG';
-    }
-
-    $log4perlconf .= 'log4perl.rootLogger=' . $log_level . ", A1\n";
-    if ( $c->config()->{'colored_log'} ) {
-        $log4perlconf .= "log4perl.appender.A1=Log::Log4perl::Appender::ScreenColoredLevels\n";
-    }
-    else {
-        $log4perlconf .= "log4perl.appender.A1=Log::Log4perl::Appender::Screen\n";
-    }
-    $log4perlconf .= "log4perl.appender.A1.layout=PatternLayout\n";
-    $log4perlconf .= "log4perl.appender.A1.layout.ConversionPattern=[%d] [Books] [%p] %m%n\n";
-
-    $c->log->debug( $K . "Log4perl-Konfiguration:\n" . $log4perlconf ) if $c->config->{'debug_level'} >= 1;
-    $c->log( Catalyst::Log::Log4perl->new( \$log4perlconf ) );
-
-    $c->log->debug( get_output_string( $K, "Aktuelle Konfiguration: ", $c->config ) ) if $c->config->{'debug_level'} >= 3;
+    $c->log->debug( get_output_string( $K, "Aktuelle Konfiguration: ", $c->config ) );
 
 } ## end sub finalize_config
 
diff --git a/log4perl.conf b/log4perl.conf
new file mode 100644 (file)
index 0000000..b2be2ef
--- /dev/null
@@ -0,0 +1,59 @@
+##############################################################################
+#
+#  Log-Konfiguration für Log::Log4perl
+#
+# Diese Konfiguration kann von einer log4perl_local.conf überschrieben werden.
+# (Kein Merging! - Siehe Log::Log4perl zu Details der Konfiguration)
+#
+# $Id$
+# $URL$
+#
+##############################################################################
+
+# Root-Logger
+log4perl.rootLogger = INFO, ScreenApp
+
+# Normaler Screen-Appender auf StdErr
+log4perl.appender.ScreenApp = Log::Log4perl::Appender::Screen
+log4perl.appender.ScreenApp.stderr = 1
+log4perl.appender.ScreenApp.utf8   = 1
+log4perl.appender.ScreenApp.layout = PatternLayout
+log4perl.appender.ScreenApp.layout.ConversionPattern = [%d] [SwAdmin] [%p] %m%n
+
+###########################
+# Alternativ mit zwei Appendern
+
+# Root-Logger
+#log4perl.rootLogger = DEBUG, ScreenApp, FileApp
+
+#layout_class   = Log::Log4perl::Layout::PatternLayout
+#layout_pattern = [%d] [SwAdmin] [%p] %m%n
+
+# Filterdefinition für den Screen-Appender
+#log4perl.filter.InfoFilter = Log::Log4perl::Filter::LevelRange
+#log4perl.filter.InfoFilter.LevelMin      = INFO
+#log4perl.filter.InfoFilter.LevelMax      = FATAL
+#log4perl.filter.InfoFilter.AcceptOnMatch = true
+
+# Normaler Screen-Appender auf StdErr
+#log4perl.appender.ScreenApp = Log::Log4perl::Appender::Screen
+#log4perl.appender.ScreenApp.stderr = 1
+#log4perl.appender.ScreenApp.utf8   = 1
+#log4perl.appender.ScreenApp.Filter = InfoFilter
+#log4perl.appender.ScreenApp.layout = ${layout_class}
+#log4perl.appender.ScreenApp.layout.ConversionPattern = ${layout_pattern}
+
+# Und der File-Appender für alles
+#log4perl.appender.FileApp = Log::Log4perl::Appender::File
+#log4perl.appender.FileApp.filename                 = /var/www/irgendwo/log/debug.log
+#log4perl.appender.FileApp.mode                     = append
+#log4perl.appender.FileApp.umask                    = 0222
+#log4perl.appender.FileApp.utf8                     = 1
+#log4perl.appender.FileApp.recreate                 = 1
+#log4perl.appender.FileApp.recreate_check_interval  = 60
+#log4perl.appender.FileApp.recreate_check_signal    = USR1
+#log4perl.appender.FileApp.layout                   = ${layout_class}
+#log4perl.appender.FileApp.layout.ConversionPattern = ${layout_pattern}
+
+
+
diff --git a/repo-browser/svnindex.css b/repo-browser/svnindex.css
new file mode 100644 (file)
index 0000000..c4330c1
--- /dev/null
@@ -0,0 +1,87 @@
+/* A sample style sheet for displaying the Subversion directory listing
+   that is generated by mod_dav_svn and "svnindex.xsl". */
+
+body{
+  margin: 0;
+  padding: 0;
+}
+
+a {
+  color: navy;
+}
+
+.footer {
+  margin-top: 8em;
+  padding: 0.5em 1em 0.5em;
+  border: 1px solid;
+  border-width: 1px 0;
+  clear: both;
+  border-color: rgb(30%,30%,50%) navy rgb(75%,80%,85%) navy;
+  background: rgb(88%,90%,92%);
+  font-size: 80%;
+}
+
+.svn {
+  margin: 3em;
+}
+
+.rev {
+  margin-right: 3px;
+  padding-left: 3px;
+  text-align: left;
+  font-size: 120%;
+}
+
+.dir a {
+  text-decoration: none;
+  color: black;
+}
+
+.file a {
+  text-decoration: none;
+  color: black;
+}
+
+.path {
+  margin: 3px;
+  padding: 3px;
+  background: #FFCC66;
+  font-size: 120%;
+}
+
+.updir {
+  margin: 3px;
+  padding: 3px;
+  margin-left: 3em;
+  background: #FFEEAA;
+}
+
+.file {
+  margin: 3px;
+  padding: 3px;
+  margin-left: 3em;
+  background: rgb(95%,95%,95%);
+}
+
+.file:hover {
+  margin: 3px;
+  padding: 3px;
+  margin-left: 3em;
+  background: rgb(100%,100%,90%);
+/*  border: 1px black solid; */
+}
+
+.dir {
+  margin: 3px;
+  padding: 3px;
+  margin-left: 3em;
+  background: rgb(90%,90%,90%);
+}
+
+.dir:hover {
+  margin: 3px;
+  padding: 3px;
+  margin-left: 3em;
+  background: rgb(100%,100%,80%);
+/*  border: 1px black solid; */
+}
diff --git a/repo-browser/svnindex.xsl b/repo-browser/svnindex.xsl
new file mode 100644 (file)
index 0000000..9d09551
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<!-- A sample XML transformation style sheet for displaying the Subversion
+  directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT"
+  directive is used. -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:output method="html"/>
+
+  <xsl:template match="*"/>
+
+  <xsl:template match="svn">
+    <html>
+      <head>
+        <title>
+          <xsl:if test="string-length(index/@name) != 0">
+            <xsl:value-of select="index/@name"/>
+            <xsl:text>: </xsl:text>
+          </xsl:if>
+          <xsl:value-of select="index/@path"/>
+        </title>
+        <link rel="stylesheet" type="text/css" href="/repo-browser/books/svnindex.css"/>
+      </head>
+      <body>
+        <div class="svn">
+          <xsl:apply-templates/>
+        </div>
+        <div class="footer">
+          <xsl:text>Powered by </xsl:text>
+          <xsl:element name="a">
+            <xsl:attribute name="href">
+              <xsl:value-of select="@href"/>
+            </xsl:attribute>
+            <xsl:text>Subversion</xsl:text>
+          </xsl:element>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="@version"/>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="index">
+    <div class="rev">
+      <xsl:value-of select="@name"/>
+      <xsl:if test="@base">
+        <xsl:if test="@name">
+          <xsl:text>:&#xA0; </xsl:text>
+        </xsl:if>
+        <xsl:value-of select="@base" />
+      </xsl:if>
+      <xsl:if test="@rev">
+        <xsl:if test="@base | @name">
+          <xsl:text> &#x2014; </xsl:text>
+        </xsl:if>
+        <xsl:text>Revision </xsl:text>
+        <xsl:value-of select="@rev"/>
+      </xsl:if>
+    </div>
+    <div class="path">
+      <xsl:value-of select="@path"/>
+    </div>
+    <xsl:apply-templates select="updir"/>
+    <xsl:apply-templates select="dir"/>
+    <xsl:apply-templates select="file"/>
+  </xsl:template>
+
+  <xsl:template match="updir">
+    <div class="updir">
+      <xsl:text>[</xsl:text>
+      <xsl:element name="a">
+        <xsl:attribute name="href">..</xsl:attribute>
+        <xsl:text>Parent Directory</xsl:text>
+      </xsl:element>
+      <xsl:text>]</xsl:text>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="dir">
+    <div class="dir">
+      <xsl:element name="a">
+        <xsl:attribute name="href">
+          <xsl:value-of select="@href"/>
+        </xsl:attribute>
+        <xsl:value-of select="@name"/>
+        <xsl:text>/</xsl:text>
+      </xsl:element>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="file">
+    <div class="file">
+      <xsl:element name="a">
+        <xsl:attribute name="href">
+          <xsl:value-of select="@href"/>
+        </xsl:attribute>
+        <xsl:value-of select="@name"/>
+      </xsl:element>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>
index 1e8cda2b5db717f301d3434c2867e8609a4c6d45..903d16ae486ba25de071ac275c012f16a345a607 100755 (executable)
@@ -1,14 +1,10 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+# $Id$
+# $URL$
 
-use strict;
-use warnings;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use FrBr::Books;
-
-FrBr::Books->run;
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('FrBr::Books', 'CGI');
 
 1;
 
@@ -24,14 +20,13 @@ See L<Catalyst::Manual>
 
 Run a Catalyst application as a cgi script.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
index 3cb6a572aff998921489e365e9106e80d3a445dc..6d1482b241e6151df7e3c8cd16b7a096cd169411 100755 (executable)
@@ -1,26 +1,13 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+
+# $Id$
+# $URL$
 
 use strict;
 use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use Catalyst::Helper;
-
-my $force = 0;
-my $mech  = 0;
-my $help  = 0;
-
-GetOptions(
-    'nonew|force'    => \$force,
-    'mech|mechanize' => \$mech,
-    'help|?'         => \$help
- );
-
-pod2usage(1) if ( $help || !$ARGV[0] );
-
-my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
 
-pod2usage(1) unless $helper->mk_component( 'FrBr::Books', @ARGV );
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('FrBr::Books', 'Create');
 
 1;
 
@@ -33,13 +20,12 @@ frbr_books_create.pl - Create a new Catalyst Component
 frbr_books_create.pl [options] model|view|controller name [helper] [options]
 
  Options:
-   -force        don't create a .new file where a file to be created exists
-   -mechanize    use Test::WWW::Mechanize::Catalyst for tests if available
-   -help         display this help and exits
+   --force        don't create a .new file where a file to be created exists
+   --mechanize    use Test::WWW::Mechanize::Catalyst for tests if available
+   --help         display this help and exits
 
  Examples:
    frbr_books_create.pl controller My::Controller
-   frbr_books_create.pl controller My::Controller BindLex
    frbr_books_create.pl -mechanize controller My::Controller
    frbr_books_create.pl view My::View
    frbr_books_create.pl view MyView TT
@@ -62,14 +48,13 @@ Existing component files are not overwritten.  If any of the component files
 to be created already exist the file will be written with a '.new' suffix.
 This behavior can be suppressed with the C<-force> option.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
index d899a1bc4e32f1ae163d4dab414de61a2628d772..fdb82f8faac4e4676749a778de816a0c8632d1b7 100755 (executable)
@@ -1,39 +1,10 @@
-#!/usr/bin/perl -w
-
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use FrBr::Books;
-
-my $help = 0;
-my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
-GetOptions(
-    'help|?'      => \$help,
-    'listen|l=s'  => \$listen,
-    'nproc|n=i'   => \$nproc,
-    'pidfile|p=s' => \$pidfile,
-    'manager|M=s' => \$manager,
-    'daemon|d'    => \$detach,
-    'keeperr|e'   => \$keep_stderr,
-);
-
-pod2usage(1) if $help;
-
-FrBr::Books->run( 
-    $listen, 
-    {   nproc   => $nproc,
-        pidfile => $pidfile, 
-        manager => $manager,
-        detach  => $detach,
-       keep_stderr => $keep_stderr,
-    }
-);
+#!/usr/bin/env perl
+
+# $Id$
+# $URL$
+
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('FrBr::Books', 'FastCGI');
 
 1;
 
@@ -44,37 +15,36 @@ frbr_books_fastcgi.pl - Catalyst FastCGI
 =head1 SYNOPSIS
 
 frbr_books_fastcgi.pl [options]
+
  Options:
    -? -help      display this help and exits
-   -l -listen    Socket path to listen on
+   -l --listen   Socket path to listen on
                  (defaults to standard input)
                  can be HOST:PORT, :PORT or a
                  filesystem path
-   -n -nproc     specify number of processes to keep
+   -n --nproc    specify number of processes to keep
                  to serve requests (defaults to 1,
                  requires -listen)
-   -p -pidfile   specify filename for pid file
+   -p --pidfile  specify filename for pid file
                  (requires -listen)
-   -d -daemon    daemonize (requires -listen)
-   -M -manager   specify alternate process manager
+   -d --daemon   daemonize (requires -listen)
+   -M --manager  specify alternate process manager
                  (FCGI::ProcManager sub-class)
                  or empty string to disable
-   -e -keeperr   send error messages to STDOUT, not
+   -e --keeperr  send error messages to STDOUT, not
                  to the webserver
 
 =head1 DESCRIPTION
 
 Run a Catalyst application as fastcgi.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
index 442232e8cac5ecfb877146a5209521b4ab92a6f6..a505e454da28befe8d0803acefb171344247078b 100755 (executable)
@@ -1,94 +1,46 @@
-#!/usr/bin/perl -w
-
-BEGIN { 
-    $ENV{CATALYST_ENGINE} ||= 'HTTP';
-    $ENV{CATALYST_SCRIPT_GEN} = 30;
-    require Catalyst::Engine::HTTP;
-}  
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-
-my $debug             = 0;
-my $fork              = 0;
-my $help              = 0;
-my $host              = undef;
-my $port              = $ENV{FRBR_BOOKS_PORT} || $ENV{CATALYST_PORT} || 3000;
-my $keepalive         = 0;
-my $restart           = $ENV{FRBR_BOOKS_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
-my $restart_delay     = 1;
-my $restart_regex     = '\.yml$|\.yaml$|\.pm$';
-my $restart_directory = undef;
-
-my @argv = @ARGV;
-
-GetOptions(
-    'debug|d'             => \$debug,
-    'fork'                => \$fork,
-    'help|?'              => \$help,
-    'host=s'              => \$host,
-    'port=s'              => \$port,
-    'keepalive|k'         => \$keepalive,
-    'restart|r'           => \$restart,
-    'restartdelay|rd=s'   => \$restart_delay,
-    'restartregex|rr=s'   => \$restart_regex,
-    'restartdirectory=s'  => \$restart_directory,
-);
-
-pod2usage(1) if $help;
-
-if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
-    $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
-}
-if ( $debug ) {
-    $ENV{CATALYST_DEBUG} = 1;
-}
+#!/usr/bin/env perl
 
-# This is require instead of use so that the above environment
-# variables can be set at runtime.
-require FrBr::Books;
+# $Id$
+# $URL$
+
+BEGIN {
+    $ENV{CATALYST_SCRIPT_GEN} = 40;
+}
 
-FrBr::Books->run( $port, $host, {
-    argv              => \@argv,
-    'fork'            => $fork,
-    keepalive         => $keepalive,
-    restart           => $restart,
-    restart_delay     => $restart_delay,
-    restart_regex     => qr/$restart_regex/,
-    restart_directory => $restart_directory,
-} );
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('FrBr::Books', 'Server');
 
 1;
 
 =head1 NAME
 
-frbr_books_server.pl - Catalyst Testserver
+frbr_books_server.pl - Catalyst Test Server
 
 =head1 SYNOPSIS
 
 frbr_books_server.pl [options]
 
- Options:
-   -d -debug          force debug mode
-   -f -fork           handle each request in a new process
-                      (defaults to false)
-   -? -help           display this help and exits
-      -host           host (defaults to all)
-   -p -port           port (defaults to 3000)
-   -k -keepalive      enable keep-alive connections
-   -r -restart        restart when files get modified
-                      (defaults to false)
-   -rd -restartdelay  delay between file checks
-   -rr -restartregex  regex match files that trigger
-                      a restart when modified
-                      (defaults to '\.yml$|\.yaml$|\.pm$')
-   -restartdirectory  the directory to search for
-                      modified files
-                      (defaults to '../')
+   -d --debug           force debug mode
+   -f --fork            handle each request in a new process
+                        (defaults to false)
+   -? --help            display this help and exits
+   -h --host            host (defaults to all)
+   -p --port            port (defaults to 3000)
+   -k --keepalive       enable keep-alive connections
+   -r --restart         restart when files get modified
+                        (defaults to false)
+   -rd --restart_delay  delay between file checks
+                        (ignored if you have Linux::Inotify2 installed)
+   -rr --restart_regex  regex match files that trigger
+                        a restart when modified
+                        (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
+   --restart_directory  the directory to search for
+                        modified files, can be set mulitple times
+                        (defaults to '[SCRIPT_DIR]/..')
+   --follow_symlinks    follow symlinks in search directories
+                        (defaults to false. this is a no-op on Win32)
+   --background         run the process in the background
+   --pidfile            specify filename for pid file
 
  See also:
    perldoc Catalyst::Manual
@@ -98,14 +50,13 @@ frbr_books_server.pl [options]
 
 Run a Catalyst Testserver for this application.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
index 778e42474b974b396dbb3376c58ffdfe9c36ee36..382b866d69084c92c5ba5269f11441f299f83337 100755 (executable)
@@ -1,20 +1,10 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use Catalyst::Test 'FrBr::Books';
+# $Id$
+# $URL$
 
-my $help = 0;
-
-GetOptions( 'help|?' => \$help );
-
-pod2usage(1) if ( $help || !$ARGV[0] );
-
-print request($ARGV[0])->content . "\n";
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('FrBr::Books', 'Test');
 
 1;
 
@@ -27,7 +17,7 @@ frbr_books_test.pl - Catalyst Test
 frbr_books_test.pl [options] uri
 
  Options:
-   -help    display this help and exits
+   --help    display this help and exits
 
  Examples:
    frbr_books_test.pl http://localhost/some_action
@@ -41,14 +31,13 @@ frbr_books_test.pl [options] uri
 
 Run a Catalyst action from the command line.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut